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

Re: [XEN PATCH 3/8] xen: address MISRA C:2012 Rule 8.4


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Wed, 9 Aug 2023 14:14:58 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=//FkV4ksvf/p2bNa4niW0ittErPqSYgl/6jmAxuAk6A=; b=DDyztEsWaZvnFX7C/iXUimseaO2iVsJn5lfXxOiwPp4ugkJYwpZzN8GTM5g/iA8Y3NO3i9ZkyoUPlzO8HRSPNZ4nXyzJ4WmpApKobghX2JlXlqAwkg4lZ9X3ZjRMBFTxwxVOval1yT4UqJhcFk+MWfM0oQfoMITCSOSmL2nXt5L2A71YKPFX3qhOU/2/gFv4K60r5vM4fJHzey8/fyKINiq4t+qCLQPGCfrJAhljwXE13oE0TZtnqYiaQVyEd5eA1K+lp99Nci3anyJOdjgMT/1SOkGgWl3AcS3CsHCQMEavwZcijxElnzGIAWIjhvaf0VVx8+6cHCYpCC2hRBeODA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NCEW01dodYRVRIBn19sJ9Mox7XpVE1L+z5hEGqg3PInX5N6Rq9yucnpPrxUl9wPACH/wClZM7qfLKfPJjTdqeBMwSn1OmzjNfGQXcBay1ChLBMEvhwAgGciapnNICUHWLpDhUbUqmfIMF6tgN5u05TOeANrTuOTbi5EjaZuhryMtxTGg2g3Gevb/KgjgEH3wOMOzSKDdg7Pgn7hgKUlKDcdCmEUFv2q1/Vvs2CPJuJEUQBV4qAUolzaPQ5Db7fZ/DDz5kBOYA88Unwkx8b0ui1jGlSZZDe1fMLfY/TWocSlw81XlEoFcZYOVniVbutKyYZPnScLnlL7+PEbVdX4Tsw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "michal.orzel@xxxxxxx" <michal.orzel@xxxxxxx>, "xenia.ragiadakou@xxxxxxx" <xenia.ragiadakou@xxxxxxx>, "ayan.kumar.halder@xxxxxxx" <ayan.kumar.halder@xxxxxxx>, "consulting@xxxxxxxxxxx" <consulting@xxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Wed, 09 Aug 2023 14:15:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZyrEYmlGLQrMXXU2mT8iNskDvw6/h+3gAgAAEg4CAAAJWgA==
  • Thread-topic: [XEN PATCH 3/8] xen: address MISRA C:2012 Rule 8.4


> On 9 Aug 2023, at 15:06, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 09.08.2023 15:50, Luca Fancellu wrote:
>>> On 9 Aug 2023, at 12:02, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx> wrote:
>>> 
>>> The variable 'saved_cmdline' can be defined static,
>>> as its only uses are within the same file. This in turn avoids
>>> violating Rule 8.4 because no declaration is present.
>>> 
>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
>>> ---
>>> xen/common/kernel.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/xen/common/kernel.c b/xen/common/kernel.c
>>> index fb919f3d9c..52aa287627 100644
>>> --- a/xen/common/kernel.c
>>> +++ b/xen/common/kernel.c
>>> @@ -28,7 +28,7 @@ CHECK_feature_info;
>>> 
>>> enum system_state system_state = SYS_STATE_early_boot;
>>> 
>>> -xen_commandline_t saved_cmdline;
>>> +static xen_commandline_t saved_cmdline;
>> 
>> I see this line was touched by fa97833ae18e4a42c0e5ba4e781173457b5d3397,
>> have you checked that making it static was not affecting anything else?
> 
> The code requiring the symbol to be non-static went away in e6ee01ad24b6
> ("xen/version: Drop compat/kernel.c"). That's where the symbol would have
> wanted to become static. But that was very easy to overlook.

Yes you are right Jan,

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>

Possibly with the Fixes tag

Cheers,
Luca


 


Rackspace

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