[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: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 7 Aug 2023 10:14:25 +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=tp4Wqs3WIyB0xU2HZc0LdtEmJywyEhfHFm4QfbYQrUs=; b=HQasCcBnwJrPm6vbRrKbFb822i3yl8bFsp6kiJQe0rffVjkjF1DnWEVY0+r2lTON7+WezDNgFaSSWVN8F/RjZ7aBii1nmhAi+PImlpYTBBxbmEQuiyecgy1ZJJHAZGHE543Cb2txTjwmBooXUe/f6c1QlarHe6e8EqdiJqupR4VLy1aXTcm8ckOJ8wn0BbDx/xWIcfQ/13VqBJevNk2JzFCS72nC6NxTThaMKpsKu6BB2lvYagdWq457AcDncIiRZEfQ1PZ5THhT5/dhRcFnC91+5WKRscBlxCl+CzRk3lw/Y/tkekOd3ktHy2IdgFd3PO4+FqTyl/PIXlJcqHviGw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SzntF4Q7LSkhShJrZ5k0sSsVOiZt7jlFelfE5pTS3C4MdSgXbBMycx1C/aylAcuQAL0PrgI9QtLavQw+yl0A0RuY48K22V1KGwVBw6ApZXwYAJ2fPQ+j7isB6OCUT51xvO60OfYw5IcufI5I2L8jRYgttEsqGo9n72yZOkFJAJ3sLi4UTKyvjVH7UDGNc0EbElADP5fLrU24BvzvHTUJZbciM035syUrTdxsYQgKhsXK4P56EdXrslpykpbmkl/h2pR5ZZUrYQfcWasD1XExGvaKnGFi05ICTzfA4ysu9Srcb5zUdq/+C1Lu/UyWEMBpyLnD3tjxiQE9BZERHyy4LQ==
  • 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: Mon, 07 Aug 2023 08:14:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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); \
})

or some such. I can take care of this while committing.

Jan



 


Rackspace

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