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

Re: [XEN PATCH 1/6] x86: rename variable 'e820' to address MISRA C:2012 Rule 5.3


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 7 Aug 2023 10:09:24 +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=3MwbzB67oxEI7ogaF4SvdyY/jTHqGNrSN6zBwjin06s=; b=kh0knZ+9LVwN23jsPuBozjOGPbhjkxanl2G5/Pok/QJKkKSSJiqckt4CpbmFuMC6oSOgBbdy+jlkGPLncfs3xCB35DH/Ah8pkBMOiVedW51oc3lIPxWqhVtlCD+hrGODL4wsb+XHz427i9VrSp5IzelKipRWaB8SnApjSjwXM+L4AhDorfljNrwh0CQGAWhgTR9sUPQWW4e4o0X4U6mUeAMqrNs+Hqe4fzGeyxhF5lIt+idxCw4eWmZ1vVuFm7Qwru8WrWVeErHdxBFPFALcfaJadA65s594SMMdfaCMe//AAb3NkOxBFQbaKSXElWUq9EIUed/SEY+rdqk9AKw3NQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EGEx9Z/ALLfB1M2ziu4d7RsCpnPsIA8iVee0iRRghoPNE5KHNKO3mUfzERpqcLECkh4AKziFQphF046/i+iDvCqAbr0M0cCnuaLPsQ6T6PAUHKGQSHMzTTN/It5GCmxoNNKzNAO/wmHQCia73zpVglKyMOm7y7WbOZ7YEQq1lxmVd3EvbMETLzk4sbaA8IzmjmfzsvKnZ1PsvxeMLkLOu+ScqMy79zbzS6MKQPBZC9MhyH2r+2BQjbmyWBepXHSl+7IbqC50aPPRXZoIxk8zIFYSZJSMUsCdJv7hOgq6m1P6SrU3jUmwBeED15ud4TSJB26oMI/9uGfB/9gfwNbgVw==
  • 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>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 07 Aug 2023 08:09:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.08.2023 17:27, Nicola Vetrini wrote:
> The variable declared in the header file 'xen/arch/x86/include/asm/e820.h'
> is shadowed by many function parameters, so it is renamed to avoid these
> violations.
> 
> No functional changes.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
> ---
> This patch is similar to other renames done on previous patches, and the
> preferred strategy there was to rename the global variable. This one
> has more occurrences that are spread in various files, but
> the general pattern is the same.

Still I think it would be better done the other way around, and perhaps in
more than a single patch. It looks like "many == 3", i.e.
- e820_add_range(), which is only ever called with "e820" as its argument,
  and hence the parameter could be dropped,
- e820_change_range_type(), which is in the same situation, and
- reserve_e820_ram(), which wants its parameter renamed.
Alternatively, if we really were to change the name of the global, we'd
want to take a more complete approach: Right now we have e820_raw[],
boot_e820[], and e820[]. We'd want them to follow a uniform naming scheme
then (e820_ first or _e820 last), with the other part of the name suitably
describing the purpose (which "map" doesn't do).

Jan



 


Rackspace

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