[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen/arm: traps: fix MISRA C 2012 Rule 8.7 violation
- To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Mon, 4 Jul 2022 08:28:27 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- 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=2; 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=29IMshbie5ViWXGGr5MDzRHkggHdrqM96r8mXJe8s4Y=; b=EN3UfxjqnmosTPXeew2JXzOkuYfJ9jka50tS8DkhlQg6kruO8rpymCtK8G3S0Kyq17QpiHS3gpVAdMFAIuSlzs1R+DuOvRB0Hj8iKhh26EhEiDOHH4b3HRWlyU2Eq6EcDos8JQJN4BRZCNUBK0SZ4QHo7jErtTrhLlbpNsz1tBvgeIAbDkfgJMTn2afHiH6msSwkGzvgojsWxMDdAMyhCGRnSyqz5cVhnlmSsTYc3m2ju0XaxKlLWAn9V9UroRxGUjvNfrBGXV0LnE5MmqNFAZHcsR7v1k6qKQ+2axw3pLMMn53XMdCVGU+zEFw9r4ha+O+2Q9UhNQNLrynQOe4ghA==
- 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=29IMshbie5ViWXGGr5MDzRHkggHdrqM96r8mXJe8s4Y=; b=Fw5hM0kDowBUVPlifWi1y1iVdNV04nIQORBoeq+nNDy8R4VQjEpgGmofid8J7StooQz4L/J9F3NSjpYcuehkQCDnmKZz7dRN6pQhXb8Opi0SRuLkPEqSKNI0D1wzsYduGmnCe0qugTXwI8SAcsX/F5yc6jh+idNCFHCz4Y2jj/4nfDsWf9aKgFKYKrBQ8dTK2FawLZsDQlIK7R/FYPdIy3DjpJy7mRLwZNIsh2gfeHye42rn5RBSRNadxo3k4xepB09IHpTVdnySsH4UCYLhTAJYQc19lBpp6eWZAl+otZaCUqrsrdZfJSvYN4I9SITSLA+vhRA6e7uI+BemsVDLwg==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=YJv07i5zWz9mai3VVLKimttv+pt00s9MFXJVjZlrbfQnQZZyVrLDBdPiwdsVH5/jThWEuBmrtsTGn5UcjCjCwokAkX5/dYsV1rWuOYm6vsyjXkX6/+0rSlhPhuIc9ZdFF8lyODQKFxvgKdLMyxq6eKXQkgxzV6EfuzFVesVuYOtqyPQoOPC4M3Hyrc4IXAx/Dsz7oPQJzrqeNH190fHpJM/ofQOp3N3W2u+ABNgj6MZiWjn6m0gqHz5xBHoLv4n3GctX9vHZn//HfqXN/K/4hpZAxcw3DRHGxeVGreLW2fQWRtXXo5WFDyJ7TImj+4pns6KStNKG+4u4A6AiS6BXyw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NqZlVRqf4cKhqjoKfD75FIftrZKTe5Ev9deB+O5LwKa+EujAgYxuaS+S0UsWngsQvmWW65WmoCRB6HMAyjtgRnbT+UewdFoxre+USUEWDe4TO/pkUWxz0dthoAexZC9Lskp/Jl4M6pStadKolWF9f5IMylrVbgbzz/aRW1AkQiGo6TNG0l2LAQ7GIKhLv7kY5Kwb5FdJmevHIqhvyAtJVTsfVBZqDcOkXX9BzDF0+Qim8aLVlpLtfQzavyh5rDzC/PDMbohYVoiQrOLu5B2+HudHgrlTRb3LBxEQnbBpgMU4uDOIFQA0Vdri+ue+/W7s+MiZNnAn66hPiFHiknblYQ==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Mon, 04 Jul 2022 08:28:44 +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: AQHYj3bjMrWoDl4sYkqZXzEqwsl1S61t0/kAgAAEv4CAAAIygIAABXWAgAAAwwA=
- Thread-topic: [PATCH] xen/arm: traps: fix MISRA C 2012 Rule 8.7 violation
> On 4 Jul 2022, at 09:25, Luca Fancellu <Luca.Fancellu@xxxxxxx> wrote:
>
>
>
>> On 4 Jul 2022, at 09:06, Xenia Ragiadakou <burzalodowa@xxxxxxxxx> wrote:
>>
>>
>>
>> On 7/4/22 10:58, Luca Fancellu wrote:
>>>>> I am not 100% sure about this patch.
>>>>> I think show_stack() should be declared the same way as show_registers().
>>>>> So either both of them will be declared with external linkage or both of
>>>>> them
>>>>> will be declared with internal linkage.
>>>>
>>>> I think that those 2 should be declared with external linkage with a
>>>> comment
>>>> explaining why they are. For me those are useful when developing or
>>>> debugging
>>>> and I sometime call those to force dumping the status.
>>>> So I would vote to keep the external linkage.
>>>>
>>>>> I decided to declare both of them static because they are referenced only
>>>>> in
>>>>> traps.c but I could have, also, add the declaration of show_stack() in
>>>>> asm/processor.h header instead. Rule 8.7 is advisory.
>>>>
>>>> As said I would vote for external linkage here but would be nice to have
>>>> other
>>>> developers view on this.
>>>>
>>> In addition to this, if we don’t want to provide a justification for those,
>>> since they seems to me
>>> code related to debugging they can be removed from “production” code in
>>> some way.
>>
>> Rule 8.7 is advisory, so I think that formal justification of deviations is
>> not necessary.
>
> Yes that is true, in that case we would only need to document it without a
> formal justification, however
> if the codebase doesn’t include them (because not in production code) I guess
> the problem doesn’t exist.
Having the production code using static and the non production using external
linkage would be kind of weird here.
I think having them always with external linkage with a justification is the
cleanest way.
Cheers
Bertrand
>
>>
>>>> Cheers
>>>> Bertrand
>>
>> --
>> Xenia
|