mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: "Anusha Srivatsa" <asrivats@redhat.com>,
	dri-devel@lists.freedesktop.org,
	"David Airlie" <airlied@gmail.com>,
	"Guido Günther" <agx@sigxcpu.org>,
	"Icenowy Zheng" <icenowy@aosc.io>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Jagan Teki" <jagan@edgeble.ai>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Jessica Zhang" <quic_jesszhan@quicinc.com>,
	"Jianhua Lu" <lujianhua000@gmail.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Michael Trimarchi" <michael@amarulasolutions.com>,
	"Michael Walle" <mwalle@kernel.org>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Ondřej Jirman" <megi@xff.cz>, "Simona Vetter" <simona@ffwll.ch>,
	"Stefan Mavrodiev" <stefan@olimex.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel@puri.sm
Subject: Re: [PATCH v3 00/30] drm/panel: Use refcounted allocation in place of devm_kzalloc() - Part2
Date: Wed, 21 May 2025 17:13:00 +0200	[thread overview]
Message-ID: <94b0548b-e48a-4bff-8611-116ed89baec3@web.de> (raw)
In-Reply-To: <20250520-drivers-mass-convert-part2-v3-0-f7ae7b723c68@redhat.com>

…
> There are a lot of occurences of the panel allocation across the
> subsystem. Much thanks to Maxime for the semanic patch which actually
> gives a list of panels allocated unsafely.

I imagine that the shown SmPL code can be improved another bit
(like the following).


@find_add@
identifier add_f, b, c;
type T;
@@
 add_f(...)
 {
 ... when any
 T *c;
 ... when any
 drm_panel_add(&c->b);
 ... when any
 }

@find_allocation@
identifier alloc_f, cal;
position p;
type find_add.T;
@@
 alloc_f(...)
 {
 ... when any
 T *cal;
 ... when any
 cal =
(      kzalloc
|      devm_kzalloc
)(...)@p;
 ... when any
 }

@script:python@
add_f << find_add.add_f;
alloc_f << find_allocation.alloc_f;
alloc_p << find_allocation.p;
@@
coccilib.report.print_report(alloc_p[0],
                             "ERROR: Panel driver is unsafely allocated in %s and added in %s"
                             % (alloc_f, add_f))


Regards,
Markus

      parent reply	other threads:[~2025-05-21 15:13 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-21  3:03 Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 01/30] panel/panel-elida-kd35t133: Use refcounted allocation in place of devm_kzalloc() Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 02/30] panel/feixin-k101-im2ba02: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 03/30] panel/fy07024di26a30d: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 04/30] panel/himax-hx83112a: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 05/30] panel/himax-hx8394: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 06/30] panel/ilitek-ili9322: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 07/30] panel/ilitek-ili9341: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 08/30] panel/panel-ili9805: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 09/30] panel/ilitek-ili9806e: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 10/30] panel/ilitek-ili9881c: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 11/30] panel/innolux-ej030na: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 12/30] panel/innolux-p079zca: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 13/30] panel/jadard-jd9365da-h3: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 14/30] panel/jdi-fhd-r63452: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 15/30] panel/ltk050h3146w: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 16/30] panel/ltk500hd1829: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 17/30] panel/lg-lg4573: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 18/30] panel/lincolntech-lcd197: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 19/30] panel/magnachip-d53e6ea8966: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 20/30] panel/mantix-mlaf057we51: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 21/30] panel/newvision-nv3051d: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 22/30] panel/newvision-nv3052c: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 23/30] panel/novatek-nt35510: " Anusha Srivatsa
2025-05-21  8:14   ` Linus Walleij
2025-05-21  3:03 ` [PATCH v3 24/30] panel/novatek-nt35560: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 25/30] panel/novatek-nt35950: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 26/30] panel/novatek-nt36523: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 27/30] panel/novatek-nt36672e: " Anusha Srivatsa
2025-05-21  3:03 ` [PATCH v3 28/30] panel/novatek-nt39016: " Anusha Srivatsa
2025-05-21  3:04 ` [PATCH v3 29/30] panel/lcd-olinuxino: " Anusha Srivatsa
2025-05-21  3:04 ` [PATCH v3 30/30] panel/orisetech-ota5601a: " Anusha Srivatsa
2025-05-21  7:30 ` [PATCH v3 00/30] drm/panel: Use refcounted allocation in place of devm_kzalloc() - Part2 Maxime Ripard
2025-05-21 15:13 ` 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=94b0548b-e48a-4bff-8611-116ed89baec3@web.de \
    --to=markus.elfring@web.de \
    --cc=agx@sigxcpu.org \
    --cc=airlied@gmail.com \
    --cc=asrivats@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=icenowy@aosc.io \
    --cc=jagan@amarulasolutions.com \
    --cc=jagan@edgeble.ai \
    --cc=javierm@redhat.com \
    --cc=kernel@puri.sm \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lujianhua000@gmail.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=megi@xff.cz \
    --cc=michael@amarulasolutions.com \
    --cc=mripard@kernel.org \
    --cc=mwalle@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_jesszhan@quicinc.com \
    --cc=simona@ffwll.ch \
    --cc=stefan@olimex.com \
    --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

all inboxes | Powered by JetHome®