[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen/arm: traps: Fix MISRA C 2012 Rule 8.4 violation
- To: Julien Grall <julien@xxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Wed, 6 Jul 2022 09:07:37 +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=IyE7le+BAxxg9H7KmKEflE2eP67E8EUeEHmzc/ony9Y=; b=OkfElylFaZqDPIXlh7F5o6iAXPqak9SsfNOFFgYVBorSTTtf24O0PUtaBtsoafhIlX7VeZmJSdNHZr4M57gpSBmvoKscrpRz483BK8V305B3YYy15GdhUBoHETnOFV/Ceictrty2WQSnOm96gmPdk01q8C7UGnZtviFfsSvuUZnZGYOqT3pYRByhau9S3AFhbm9hsoX/u3kx8/17W2Hai0W0ltwJQcrHGJ0WqDXjyq+JEe6qTrAhKU3WP1NyNA4Q12hLVjH+kwncqXIFtl0ughMRwEizq9/xSqw5xIlH6VrM2ek+0DjMlJ92JbL+W3NvY13jRy9roS+W+mn4177jhg==
- 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=IyE7le+BAxxg9H7KmKEflE2eP67E8EUeEHmzc/ony9Y=; b=iVHsCHG3WkuoPEdlwQZOolIqgNJ6lx7tbXVRbeFe9iYxC/Xnq5riKFUIlcw91T4wZH0RMbcHUcu+2OuBCbRdRo/qjL8PTJ85tUi70HhuWNPWFOZU+RZlQ/P/SSezJuuuplxiolcEuwiQMjpMzid5qaRK/Gute7YCSctdCzt1QH8Rj8HZyzAVA1s0Uh/bZAhg/Ui3DbVj6biu+BE5U7mcBL9G/jIWi1HL2YFFkDMRWcaXBdlGweG8ipydn07cGcBPINhtUkZgU2gZMIGEdNFZl5jQxMC5u2PZjxnixWH+L8kDBfpxl5IZ1a/9UhOzPXnyZEVuYErWvycPCDu++X/IyQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=TP/xjKxbJXR/eDogdQ3VXlHVhgHjYjHxxu/sBHITP1giPKIwzREk2OXQlfx05bMMoTnIorOWtJ1hBdF4mrBuY0ZeNUsj/Y322oEKV0qd5y2W1zSB8TyAhE8L5ss5jR2YVU0tyHHw0gnKt4xC7Cd9PI7ioyfwIVjkFYInza48fL9IpMkEOS6tuHJEBudEwTcINHYZx/Y916gQABJK7xn2pr6BCEVwtsAmuVGF9lQoTPsFm9uMRvdu9Q0oKtrpLaKYplPofOhZVI/uGagy80AZy2oqYXvB/YiyTidiJ5jdjyV7d9t1rakc+jxI8Y2pp/j3yWxym+L0MhGAgBTKv+jTWw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=INlQzSNuJEF5kFO6FnanYV70vRliuVPiSffMAhu3EEzBQIWoBsN2MYoOCqsMIgniLiYLQ1lWzmu8B2mdtOtSjBg4Vadviduo8Sy3cfuAs349WQOQOQqJNxJ6eN7XmGkpc8f/frYl3o/fCqSOt3IQm43I+bBvz6E6AaiwedT/DLJ+tcvV2Phs9Q9IKWl5uGwRG6NpZjHi5eHQOi1mqw2mjwz0P4D2c5NMPISHRKw/KqkZIvx/t4s5bmoDmkOWRoGkWWF8tD2pI039E6UiZKkb8ZePs0WyLYkaCjHEY6nBV169cFJHxYNs/L4TaMdRX5JbOJ0/zSjdDi0Z5bsl6H0NHg==
- 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@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Wed, 06 Jul 2022 09:07:51 +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: AQHYkGnF2mJV3nmWm0mEL2tvTat45a1wVMEAgAC6FgA=
- Thread-topic: [PATCH] xen/arm: traps: Fix MISRA C 2012 Rule 8.4 violation
Hi Julien,
> On 5 Jul 2022, at 23:01, Julien Grall <julien@xxxxxxx> wrote:
>
> Hi Xenia,
>
> On 05/07/2022 13:21, Xenia Ragiadakou wrote:
>> Add the function prototype of show_stack() in <asm/processor.h> header file
>> so that it is visible before its definition in traps.c.
>> Although show_stack() is referenced only in traps.c, it is declared with
>> external linkage because, during development, it is often called also by
>> other files for debugging purposes. Declaring it static would increase
>> development effort. Add appropriate comment
>> Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
>
> With one request below:
>
> Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
>
>> ---
>> xen/arch/arm/include/asm/processor.h | 2 ++
>> 1 file changed, 2 insertions(+)
>> diff --git a/xen/arch/arm/include/asm/processor.h
>> b/xen/arch/arm/include/asm/processor.h
>> index 4188ec6bfb..c021160412 100644
>> --- a/xen/arch/arm/include/asm/processor.h
>> +++ b/xen/arch/arm/include/asm/processor.h
>> @@ -558,7 +558,9 @@ extern register_t __cpu_logical_map[];
>> void panic_PAR(uint64_t par);
>> void show_execution_state(const struct cpu_user_regs *regs);
>> +/* Debugging functions are declared with external linkage to aid
>> development. */
>
> I agree that those functions are only used for debugging today. But there are
> no reason they can't be used in code in the future.
> So I would like this comment to be dropped because it could easily become
> stale.
I think if someone is one day using this somewhere else then he should remove
the comment but in the current state the comment
would be useful so that the next one going through Misra violations is not
trying to fix it.
In the mid-term, if we have a standard way to document violations then the
comment should be replaced by it.
>
> If the others argue for keeping it, then I think...
>
>> void show_registers(const struct cpu_user_regs *regs);
>> +void show_stack(const struct cpu_user_regs *regs);
>
> ... we need a newline here so it is clearer which set of functions you are
> referring to (at the moment one may think that dump_execution_state()) is
> also included.
agree
Cheers
Bertrand
>
>> //#define dump_execution_state()
>> run_in_exception_handler(show_execution_state)
>> #define dump_execution_state() WARN()
>>
>
> Cheers,
>
> --
> Julien Grall
|