[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <05674791-41e7-d701-0dad-8577229849ba@csgroup.eu>
Date: Sun, 12 Jun 2022 15:21:01 +0000
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Alexey Dobriyan <adobriyan@...il.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-modules@...r.kernel.org" <linux-modules@...r.kernel.org>
Subject: Re: [PATCH] module: Fix selfAssignment cppcheck warning
Le 12/06/2022 à 12:46, Alexey Dobriyan a écrit :
>> @@ -33,7 +33,8 @@
>> #ifdef CONFIG_STRICT_MODULE_RWX
>> # define strict_align(X) PAGE_ALIGN(X)
>> #else
>> -# define strict_align(X) (X)
>> +/* OR with zero to avoid cppcheck selfAssignment warning */
>> +# define strict_align(X) ((X) | 0)
>> #endif
>
> Can these myopic tools be taught to see around and notice second
> definition which does mutate variable so there is no self-assignment?
I guess not.
However, usually we use static inlines to avoid that. I'll send v2, will
be cleaner.
Powered by blists - more mailing lists