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

Re: [XEN PATCH 3/6] xen/delay: address MISRA C:2012 Rule 5.3.


  • To: Julien Grall <julien@xxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 7 Aug 2023 11:15:39 +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=4h6z3WyN3wa+yY6xiHVHLFx4QglzfI4KodSAg0zofwQ=; b=lL9FQ7P8ILenxGOkgybY1zxonAiJ1EviKs469bOjKMxFwFH0OB9agtw6lKHxdMQaA8bOObtImww2wlA5NlavFCn/GO8+YzZcN2HCdVqszcGbFkfS8u8augeNqcMVVysqjOyhRKDezLZNkYS5Ry9DDjD9erjtDNn3AAMyyGvzX21+b+dlNg+z/H6vbNF+RLOFG/ssnIHwn6zOHxsCjg0w/mY50cKv5/e19YHLh4gUedjPcDvDb6Txgb4yAz7GJruakE/3PFVF6Yy7Uh19Mcmm5/hhS6HDp0YNbJ1IfBquSAwgA0471jQiNv+JXdjTzTZ/4BbE3a1ldMYAVjee/GFZDQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nk0nFrDQCRDnC24AI2gRFoECFwGzx6UZ4QBARx6HmBZGWQpKWXEGSzlvvaiEJWSx2hOJSxQ6N8GqiTqMe/626w8ys5+qrpZJ6XHgsy44mxOyXSu28rKNJtmxD4+JtprvIvJa49MLTVp0HXRnQN/g2RIHXRFPBRSZUY5f4+yVZFfg8EDZrquDUuy3hplEqtKwGe5l/zTuTQ3v3K/V+Bd6yBU5jsfPmkRGV63u2zYju61TRqOpi04OMGMLidMmy9qVW1fgoEmxsAIrToiVrKmNvCpLhiRxnVce4oStRHFys7r1haBMl3AjST0r6yaG9nCRkT0X4aLo6ijqz42d/W7ffA==
  • 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>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 07 Aug 2023 09:16:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.08.2023 11:01, Julien Grall wrote:
> On 07/08/2023 09:14, Jan Beulich wrote:
>> On 04.08.2023 17:27, Nicola Vetrini wrote:
>>> --- a/xen/include/xen/delay.h
>>> +++ b/xen/include/xen/delay.h
>>> @@ -5,6 +5,6 @@
>>>   
>>>   #include <asm/delay.h>
>>>   #define mdelay(n) (\
>>> -   {unsigned long msec=(n); while (msec--) udelay(1000);})
>>> +   {unsigned long msec_=(n); while (msec_--) udelay(1000);})
>>
>> As elsewhere, please also adjust style while touching the line, at
>> least as far as the obviously wrong case goes:
>>
>> #define mdelay(n) (\
>>      {unsigned long msec_ = (n); while (msec_--) udelay(1000);})
>>
>> Even better would be
>>
>> #define mdelay(n) ({ \
>>      unsigned long msec_ = (n); while (msec_--) udelay(1000); \
>> })
> 
> If you are touching the style, about converting to a staging inline and 
> also splitting the line in multiple one?

I'd be happy about this being done, but I wouldn't want to go as far with
on-commit adjustments. Nicola, are you up to doing so in v2?

Jan



 


Rackspace

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