mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: christophe.leroy@csgroup.eu
Cc: linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org
Subject: Re: [PATCH] module: Fix selfAssignment cppcheck warning
Date: Sun, 12 Jun 2022 13:46:36 +0300	[thread overview]
Message-ID: <YqXEDCzsYvDKsgQa@localhost.localdomain> (raw)

> @@ -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?

             reply	other threads:[~2022-06-12 10:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-12 10:46 Alexey Dobriyan [this message]
2022-06-12 15:21 ` Christophe Leroy
  -- 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=YqXEDCzsYvDKsgQa@localhost.localdomain \
    --to=adobriyan@gmail.com \
    --cc=christophe.leroy@csgroup.eu \
    --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®