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

Re: [XEN PATCH v2 2/5] xen/delay: address MISRA C:2012 Rule 5.3.


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 8 Aug 2023 15:57:19 +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=e67eX2oDl6jpU/qekLSK4xUFjZSfHvdrTMKP+TQ/U1s=; b=kwB0FqKkbZN9dNdtnMHvuzg6D69XWenjhGzGSXjycqNyXqurEGPibbiq/HQNWxr9JuEISddZ6s0CNZeCumAAso1Trmeimf6eNvaeFWROHR9+5Fg/8IN0mzgBDnKqRJd+AQw5IVD6CFv+hVMBv53kwMzfdH8m/EIdK7Cxn4l6tiBLHqOs3zIRXglaiDKMAcDdxsqmyHjc3lSupYucfMdvISwWt1L7IJYVa9KhkP0CEO1qMe+Q2AAh39VZJUbEyCzeqIY+Jfpz66L7qJrahJKln4BBVjn+ayayoMq+dFq6S1xrX4skwYU9MmIJLGcTBgT4c6/8ryd3O8lJ12ex/PO1og==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=grazFLqUtDII6jduNncHAG0SFaC4y8tAZBbZdOCweSQCB01G3jkRkqZENfSWVQo8YdHHYefy5IfYBK2zddAuYh0qBqhv/Qtvs9DLw/YKPERbyD42HiKehtYRUu6WYcg5uWM842viTqChb0lLg0Lse3cnksF6EbXN/Y9j14RhgLMKxiiLJWf2Y3I0wGIOWOlKSCmKp+HM0KEdNZWPY76wuWO63k/zIxYmVEbnj5zsJQWLp4SjpkpjeYeYIX4tLUn0bUvegB4PfDYV4UTh4hkLHTm1rbW3eWx8lHitCYjBT51S2qcM81DgnYBUcbYfKxHUKUMbg/oRhQJzxhQWLY/oXA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: sstabellini@xxxxxxxxxx, michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 08 Aug 2023 13:57:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.08.2023 15:56, Jan Beulich wrote:
> On 08.08.2023 13:08, Nicola Vetrini wrote:
>> --- a/xen/include/xen/delay.h
>> +++ b/xen/include/xen/delay.h
>> @@ -4,7 +4,12 @@
>>  /* Copyright (C) 1993 Linus Torvalds */
>>  
>>  #include <asm/delay.h>
>> -#define mdelay(n) (\
>> -    {unsigned long msec=(n); while (msec--) udelay(1000);})
>> +
>> +static inline void mdelay(unsigned long n)
>> +{
>> +    unsigned long msec=n;
>> +    while ( msec-- )
>> +        udelay(1000);
>> +}
> 
> Nit: Style (blanks around = and blank line between declaration and
> statement). If need be I guess this again can be taken care of while
> committing. With the adjustments
> Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Actually - why have a local variable here at all? Just name the
function parameter "msec".

Jan



 


Rackspace

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