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

Re: [XEN PATCH 02/11] x86: move declarations to address MISRA C:2012 Rule 2.1


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 3 Aug 2023 11:01:29 +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=xFyfZvvP2uaovuJM+c1ngdvlhJmsALwSlhhtKueHeYA=; b=S6OftbX2/6CSdDn4UVTWGQekGhbBIEK85oVj77gugB4HLT9HPZYOhfqIeIDuY8cnZ6ARkBi9+Cf0a70pu03hxuZvnOMd1N5NZkiCmDri8NmBEb2lDomX1L4FIFT+oNIpvUfPme9vGABgvG2WYkneo9meBYiLBryDsd/CVGTaaxNYxP54Tz/vFKqNifsxFvVLNEKSjdswEVloz88ojSgdU8LWhRvbehmQNtPWYDK8XwQecQMzjE5nFsvLNUGPB3H+tfG9nWsFgluudjvaxL6t/WV1fHwnXWFknEfx7Re5JgIV5XKAtLdz9iPnkr6KCAY1NAdCX4fovkMd6Y8T9ncgZQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jd0na9u7ndVbVsUbaSUfbXNpGgOgtpm/X8Y8z6yCE1Y7xfMM5/rWua575TNrGU7cIypZwAJHfMja9oNFrLwQw61h4kcstX+2LEIyoVmpLpqZjLK1DSSDlAPs9VywNIVni6BxMZIwRd6mkBKMPnvUm5SHogxXTJzLAZbtS26l6Q/SL3WOuHaPBHRZf4t+70ufVu7UnWE8D81EEFmYPGtqIdQ5wcCH13FiNGK06Ma7ZHKlhce6lYQTF7sVN9aWkGsYfM14nDv23s5AoVr7fdnTliGT3PXq9/R1E3DW4eYrrm6Df8CB3frtJVeJj5RWVQz+X8JDBbB8mLCxE6QU9BwPCg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 03 Aug 2023 09:01:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.08.2023 04:13, Stefano Stabellini wrote:
> On Wed, 2 Aug 2023, Nicola Vetrini wrote:
>> @@ -1169,8 +1170,6 @@ static void cf_check irq_guest_eoi_timer_fn(void *data)
>>  
>>      switch ( action->ack_type )
>>      {
>> -        cpumask_t *cpu_eoi_map;
> 
> It is only used by case ACKTYPE_EOI so it can be moved there (with a new
> block):
> 
> 
>     case ACKTYPE_EOI:
>     {
>         cpumask_t *cpu_eoi_map = this_cpu(scratch_cpumask);
>         cpumask_copy(cpu_eoi_map, action->cpu_eoi_map);
>         spin_unlock_irq(&desc->lock);
>         on_selected_cpus(cpu_eoi_map, set_eoi_ready, desc, 0);
>         return;
>     }
>     }

This pattern (two closing braces at the same level) is why switch scope
variable declarations were introduced (at least as far as introductions
by me go). If switch scope variables aren't okay (which I continue to
consider questionable), then this stylistic aspect needs sorting first
(if everyone else thinks the above style is okay - with the missing
blank line inserted -, then so be it).

Jan



 


Rackspace

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