Coccinelle archive mirror
 help / color / mirror / Atom feed
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: Sat, 27 Sep 2025 11:33:47 +0200	[thread overview]
Message-ID: <b994f006-552b-41a8-9714-5efef68f2f12@web.de> (raw)
In-Reply-To: <20250924140126.23027-1-o.petrov@ispras.ru>

…> +// find devm-allocated (devres-managed) second arg for drm*init functions
> +@badarg exists@
> +position p;
> +expression devm,e;
> +@@
> +// only devm_kzalloc is really used
> +devm = \(devm_kzalloc\|devm_kcalloc\|devm_kmalloc\|devm_kmalloc_array\)(...);
> +...
…> +// same as above, but with an intermediate local variable
> +@badarg2 exists@
> +position p;
> +expression devm,e;
> +identifier vitm;
> +@@
> +// only devm_kzalloc is really used
> +devm = \(devm_kzalloc\|devm_kcalloc\|devm_kmalloc\|devm_kmalloc_array\)(...);
> +...
> +vitm = <+...devm...+>;
…

Your source code search approach affects recurring development concerns.

The shown rules start with the same SmPL code.
Thus I would find it nicer if such duplicate code can be avoided.
I imagine that software run time characteristics would be more desirable
if selected data processing does not need to be repeated.

The search should obviously be continued after a relevant source code place was found.


…> +@script:python depends on report@
> +p << badarg.p;
…> +@script:python depends on report@
> +p << badarg2.p;
…> +@script:python depends on report@
> +p << badfield.p;
…

Will development interests grow for another clarification approach?

Support for SmPL rule groups
2019-04-07
https://github.com/coccinelle/coccinelle/issues/164

Regards,
Markus

      parent reply	other threads:[~2025-09-27  9:34 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
2025-09-27  9:33 ` Markus Elfring [this message]

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=b994f006-552b-41a8-9714-5efef68f2f12@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).