[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v2 12/13] xen/x86: fix violations of MISRA C:2012 Rule 7.2


  • To: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 6 Jul 2023 18:22:40 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4VUaRakA8WXAnt74HRa63Lz7G4ULWu80U3CpXtW1wTI=; b=IuvRYFh6MBo3CnBMC3mROYiOmTPUY+W+8f65HKZFU2F0Ty4JgXS5wJ0RLi2Rgjta68whQHz8PrPrvk2YB6Z3kv43SKazGsiKQhvelVGCesoAzE0ZQmDwSXhyk1PGbRyio/+Q1mjQO7Ne7EqMChlYqAcL0/Q7uZ7/mGn+7HNARktyFVbIyhzp8lyooA8zb2ANF63QML51WuGc1CpHx91b1R8dM5KDTY270PS7vVL4OGq/5N5Ly+d5PPvSRayJbPqPNpwB/xlD05vk8+UccDc7MqybisalldDCQij603yqamHmWxYKGsmx2gTAb3Cee9lbkQxP41NdisEoFJGr+JacaQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y+OsARf3630O7JzDGdYUpxqzq9d1br5GepZSPyj57hC9r/p3i4KUgJtvgOVPPfat5YAeg9oKy6aiLW4LMuuTk7lxnfxFeqoznG8VJdkTrvtNPPqcFsPymEKzYS83GIAa5WLzGw7XcUPyR2P7AJLdCPWDT9D3LvZKBWVaiH3E2Fjx8OSaZaoi3m+p4syijJES0pXymslJkKpykhiWCMezEIzNNkjRFlkfKuq0xmegdnkkpGtUsMsVz+MZjR+KVY5AxypXpcH7LIGcWu6Lb8s2gB/bCxSCRjos9/XeJqAZ74+O79s+ETOHdyPqzSCLRBN2hcbuu8V8vtAoUAWBXAoEEg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: consulting@xxxxxxxxxxx, Gianluca Luparini <gianluca.luparini@xxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Xenia Ragiadakou <Xenia.Ragiadakou@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 06 Jul 2023 16:22:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.07.2023 18:08, Simone Ballarin wrote:
> Il giorno gio 6 lug 2023 alle ore 10:26 Jan Beulich <jbeulich@xxxxxxxx> ha
> scritto:
> 
>> On 05.07.2023 17:26, Simone Ballarin wrote:
>>> --- a/xen/arch/x86/apic.c
>>> +++ b/xen/arch/x86/apic.c
>>> @@ -1211,7 +1211,7 @@ static void __init calibrate_APIC_clock(void)
>>>       * Setup the APIC counter to maximum. There is no way the lapic
>>>       * can underflow in the 100ms detection time frame.
>>>       */
>>> -    __setup_APIC_LVTT(0xffffffff);
>>> +    __setup_APIC_LVTT(0xffffffffU);
>>
>> While making the change less mechanical, we want to consider to switch
>> to ~0 in this and similar cases.
>>
> 
> Changing ~0U is more than not mechanical: it is possibly dangerous.
> The resulting value could be different depending on the architecture,
> I prefer to not make such kind of changes in a MISRA-related patch.

What do you mean by "depending on the architecture", when this is
x86-only code _and_ you can check what type parameter the called
function has?

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.