mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-modules@vger.kernel.org" <linux-modules@vger.kernel.org>
Subject: Re: [PATCH] module: Fix selfAssignment cppcheck warning
Date: Sun, 12 Jun 2022 15:21:01 +0000	[thread overview]
Message-ID: <05674791-41e7-d701-0dad-8577229849ba@csgroup.eu> (raw)
In-Reply-To: <YqXEDCzsYvDKsgQa@localhost.localdomain>



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.

  reply	other threads:[~2022-06-12 15:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-12 10:46 Alexey Dobriyan
2022-06-12 15:21 ` Christophe Leroy [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-06-12 10:17 Christophe Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05674791-41e7-d701-0dad-8577229849ba@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=adobriyan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®