[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yr9rA5U/Sa0Tamau@bombadil.infradead.org>
Date: Fri, 1 Jul 2022 14:45:39 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: Christophe Leroy <christophe.leroy@...roup.eu>
Cc: linux-modules@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v2] module: Fix selfAssignment cppcheck warning
On Sun, Jun 12, 2022 at 05:21:56PM +0200, Christophe Leroy wrote:
> cppcheck reports the following warnings:
>
> kernel/module/main.c:1455:26: warning: Redundant assignment of 'mod->core_layout.size' to itself. [selfAssignment]
> mod->core_layout.size = strict_align(mod->core_layout.size);
> ^
> kernel/module/main.c:1489:26: warning: Redundant assignment of 'mod->init_layout.size' to itself. [selfAssignment]
> mod->init_layout.size = strict_align(mod->init_layout.size);
> ^
> kernel/module/main.c:1493:26: warning: Redundant assignment of 'mod->init_layout.size' to itself. [selfAssignment]
> mod->init_layout.size = strict_align(mod->init_layout.size);
> ^
> kernel/module/main.c:1504:26: warning: Redundant assignment of 'mod->init_layout.size' to itself. [selfAssignment]
> mod->init_layout.size = strict_align(mod->init_layout.size);
> ^
> kernel/module/main.c:1459:26: warning: Redundant assignment of 'mod->data_layout.size' to itself. [selfAssignment]
> mod->data_layout.size = strict_align(mod->data_layout.size);
> ^
> kernel/module/main.c:1463:26: warning: Redundant assignment of 'mod->data_layout.size' to itself. [selfAssignment]
> mod->data_layout.size = strict_align(mod->data_layout.size);
> ^
> kernel/module/main.c:1467:26: warning: Redundant assignment of 'mod->data_layout.size' to itself. [selfAssignment]
> mod->data_layout.size = strict_align(mod->data_layout.size);
> ^
>
> This is due to strict_align() being a no-op when
> CONFIG_STRICT_MODULE_RWX is not selected.
>
> Transform strict_align() macro into an inline function. It will
> allow type checking and avoid the selfAssignment warning.
>
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
Queued up thanks!
Luis
Powered by blists - more mailing lists