From: Markus Elfring <Markus.Elfring@web.de>
To: cocci@inria.fr
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Subject: [cocci] How to delete selected redundant null pointer checks with SmPL?
Date: Wed, 30 Apr 2025 15:09:06 +0200 [thread overview]
Message-ID: <09b11b9c-21af-4c9d-b818-b0029bca5b9d@web.de> (raw)
Hello,
I noticed also the contribution “[PATCH] drm/amdgpu/userq: remove unnecessary NULL check”
by Dan Carpenter.
https://lore.kernel.org/kernel-janitors/aBHZuejTTKkdnGaZ@stanley.mountain/
https://lkml.org/lkml/2025/4/30/389
I got into the mood to convert the source code adjustment approach into another
script variant for the semantic patch language.
@deletion@
identifier member, object, pointer;
expression e;
@@
pointer = &object.member;
<+... when != pointer = e
(
-pointer &&
...
)
...+>
Questionable test result (also with the software combination “Coccinelle 1.3-00083-g4093aad2d”):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> git checkout next-20250430 && spatch …/Projekte/Coccinelle/janitor/delete_redundant_check.cocci drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
…
deletion: position variables or mixed modifs interfere with comm_assoc iso
bool (pointer && ...)
…
Unfortunately, the known patch is not generated at the moment.
How will development interests evolve further?
Regards,
Markus
next reply other threads:[~2025-04-30 13:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 13:09 Markus Elfring [this message]
2025-04-30 13:51 ` [cocci] How to delete selected redundant null pointer checks with SmPL? Julia Lawall
[not found] ` <9c26bec1-887e-48dd-a72e-20dd13e41a95@stanley.mountain>
2025-04-30 14:02 ` Julia Lawall
2025-04-30 14:21 ` Markus Elfring
2025-04-30 14:23 ` Julia Lawall
2025-04-30 14:30 ` Markus Elfring
2025-04-30 14:15 ` Markus Elfring
2025-04-30 15:18 ` Markus Elfring
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=09b11b9c-21af-4c9d-b818-b0029bca5b9d@web.de \
--to=markus.elfring@web.de \
--cc=cocci@inria.fr \
--cc=dan.carpenter@linaro.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).