From: Markus Elfring <Markus.Elfring@web.de>
To: Oleg Petrov <o.petrov@ispras.ru>,
cocci@inria.fr, dri-devel@lists.freedesktop.org,
lvc-project@linuxtesting.org,
Julia Lawall <Julia.Lawall@inria.fr>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
David Airlie <airlied@gmail.com>,
Maxime Ripard <mripard@kernel.org>,
Nicolas Palix <nicolas.palix@imag.fr>,
Simona Vetter <simona@ffwll.ch>,
Thomas Zimmermann <tzimmermann@suse.de>,
Vadim Mutilin <mutilin@ispras.ru>
Subject: Re: [cocci] [PATCH] cocci: drm: report devm-allocated arguments and fields
Date: Wed, 24 Sep 2025 17:08:39 +0200 [thread overview]
Message-ID: <1071f2af-39be-425b-bdb0-7f004a6e8f65@web.de> (raw)
In-Reply-To: <20250924140126.23027-1-o.petrov@ispras.ru>
> Add two Coccinelle rules: (1) flag a devres-managed pointer
> passed to a drm-init function, and (2) flag a devres-managed
> pointer assigned to a field of drm-managed struct. …
I suggest to start each enumeration item on a separate text line.
Would you like to refer to “Coccinelle: api:” in the patch prefix?
…> +// Copyright: (C) 2025 Oleg Petrov ISPRAS
Would another delimiter be helpful between the personal name and the organisation identifier?
…> +virtual report
> +virtual org
The restriction on the support for two operation modes will need further development considerations.
…> +devm = \(devm_kzalloc\|devm_kcalloc\|devm_kmalloc\|devm_kmalloc_array\)(...);
Would it be nicer to write such SmPL disjunctions on multiple lines?
…> +@script:python depends on report@
> +p << badarg.p;
> +@@
> +msg = "WARNING devm-allocated argument in a drm-init; use drmm-init family (or drmm-alloc)."
> +coccilib.report.print_report(p[0], msg)
I would like to point out once more that such data can be printed
also without an extra variable like “msg”.
> +@script:python depends on org@
> +p << badarg.p;
> +@@
> +msg = "WARNING devm-allocated argument in a drm-init; use drmm-init family (or drmm-alloc)."
> +coccilib.org.print_report(p[0], msg)
Would the following method call be more appropriate?
coccilib.org.print_todo(p[0],
"WARNING: devm-allocated argument in a drm-init; use drmm-init family (or drmm-alloc).")
Regards,
Markus
next prev parent reply other threads:[~2025-09-24 15:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 14:01 [cocci] [PATCH] cocci: drm: report devm-allocated arguments and fields Oleg Petrov
2025-09-24 15:08 ` Markus Elfring [this message]
2025-09-27 9:33 ` 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=1071f2af-39be-425b-bdb0-7f004a6e8f65@web.de \
--to=markus.elfring@web.de \
--cc=Julia.Lawall@inria.fr \
--cc=airlied@gmail.com \
--cc=cocci@inria.fr \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=mutilin@ispras.ru \
--cc=nicolas.palix@imag.fr \
--cc=o.petrov@ispras.ru \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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).