[PATCH] devtools/cocci: change boolean negation to bitwise negation
Stephen Hemminger
stephen at networkplumber.org
Thu Jul 6 20:02:45 CEST 2023
On Fri, 4 Mar 2022 23:31:53 +0800
Weiguo Li <liwg06 at foxmail.com> wrote:
> Combining boolean operator with bitwise operator is suspicious. When
> this happens, it has a chance that the bitwise negation operation is
> mistakenly written as a boolean negation operation. This script is
> used to find this kind of problems.
>
> example:
> if (x & !BITS_MASK)
> changed to:
> if (x & ~BITS_MASK)
>
> The idea came from a demo script in coccinelle website:
> https://coccinelle.gitlabpages.inria.fr/website/rules/notand.html
>
> Signed-off-by: Weiguo Li <liwg06 at foxmail.com>
This never got merged probably because it address something that is not
happening in DPDK. Ran the script and it found nothing.
Also, script adds empty blank line at EOF which cause a warning
when merging in git.
Dropping this patch as not needed.
More information about the dev
mailing list