Convert drivers to use the API - devm_drm_panel_alloc().
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.

virtual report

@ find_add @
identifier add_f;
identifier c;
identifier b;
expression d;
position p;
identifier r;
type T;
@@
add_f(...)
{
...
- T *c;
+ T *c;
...
(
drm_panel_add(&c->b)@p;
)
...
}
@ find_allocation depends on find_add @
identifier alloc_f;
type find_add.T;
identifier cal;
position p;
@@
alloc_f(...)
{
...
- T *cal;
+ T *cal;
...
(
 cal = kzalloc(...)@p;
|
 cal = devm_kzalloc(...)@p;
)
...
}
@ script:python depends on report && (find_add && find_allocation) @
add_f << find_add.add_f;
alloc_f << find_allocation.alloc_f;
add_p << find_add.p;
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))

The changes to the list of panels that this script gives is done manually.

Part 1 of the series : https://patchwork.freedesktop.org/series/147082/
is already merged. Sending this next part that covers next 30 drivers.

Sending in batches for easier review.

Minor changes in this version: 2 alignment fixes and 2 refactor and
1 compilation fix.

This took a while to resend mainly due to being away (out of office),
workstation issues because of which lost the work directory that dim
had created and had to start afresh.

Signed-off-by: Anusha Srivatsa <asriv...@redhat.com>
---
Changes in v3:
- Alignment fixes - patch 13 and 22.
- Refactors: patch 15 and 18.
- Compilation fix: Patch 18.
- Link to v2: 
https://lore.kernel.org/all/20250403-b4-drm_panel_mass_convert_part2-v2-0-260c8a44c...@redhat.com/

Changes in v2:
- Remove drm_panel_init() from probe function in ilitek-ili9341 driver. 
- Link to v1: 
https://lore.kernel.org/r/20250402-b4-drm_panel_mass_convert_part2-v1-0-903b70999...@redhat.com

Signed-off-by: Anusha Srivatsa <asriv...@redhat.com>

---
Anusha Srivatsa (30):
      panel/panel-elida-kd35t133: Use refcounted allocation in place of 
devm_kzalloc()
      panel/feixin-k101-im2ba02: Use refcounted allocation in place of 
devm_kzalloc()
      panel/fy07024di26a30d: Use refcounted allocation in place of 
devm_kzalloc()
      panel/himax-hx83112a: Use refcounted allocation in place of devm_kzalloc()
      panel/himax-hx8394: Use refcounted allocation in place of devm_kzalloc()
      panel/ilitek-ili9322: Use refcounted allocation in place of devm_kzalloc()
      panel/ilitek-ili9341: Use refcounted allocation in place of devm_kzalloc()
      panel/panel-ili9805: Use refcounted allocation in place of devm_kzalloc()
      panel/ilitek-ili9806e: Use refcounted allocation in place of 
devm_kzalloc()
      panel/ilitek-ili9881c: Use refcounted allocation in place of 
devm_kzalloc()
      panel/innolux-ej030na: Use refcounted allocation in place of 
devm_kzalloc()
      panel/innolux-p079zca: Use refcounted allocation in place of 
devm_kzalloc()
      panel/jadard-jd9365da-h3: Use refcounted allocation in place of 
devm_kzalloc()
      panel/jdi-fhd-r63452: Use refcounted allocation in place of devm_kzalloc()
      panel/ltk050h3146w: Use refcounted allocation in place of devm_kzalloc()
      panel/ltk500hd1829: Use refcounted allocation in place of devm_kzalloc()
      panel/lg-lg4573: Use refcounted allocation in place of devm_kzalloc()
      panel/lincolntech-lcd197: Use refcounted allocation in place of 
devm_kzalloc()
      panel/magnachip-d53e6ea8966: Use refcounted allocation in place of 
devm_kzalloc()
      panel/mantix-mlaf057we51: Use refcounted allocation in place of 
devm_kzalloc()
      panel/newvision-nv3051d: Use refcounted allocation in place of 
devm_kzalloc()
      panel/newvision-nv3052c: Use refcounted allocation in place of 
devm_kzalloc()
      panel/novatek-nt35510: Use refcounted allocation in place of 
devm_kzalloc()
      panel/novatek-nt35560: Use refcounted allocation in place of 
devm_kzalloc()
      panel/novatek-nt35950: Use refcounted allocation in place of 
devm_kzalloc()
      panel/novatek-nt36523: Use refcounted allocation in place of 
devm_kzalloc()
      panel/novatek-nt36672e: Use refcounted allocation in place of 
devm_kzalloc()
      panel/novatek-nt39016: Use refcounted allocation in place of 
devm_kzalloc()
      panel/lcd-olinuxino: Use refcounted allocation in place of devm_kzalloc()
      panel/orisetech-ota5601a: Use refcounted allocation in place of 
devm_kzalloc()

 drivers/gpu/drm/panel/panel-elida-kd35t133.c          | 10 ++++------
 drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c     | 11 +++++------
 drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c | 10 ++++------
 drivers/gpu/drm/panel/panel-himax-hx83112a.c          | 10 +++++-----
 drivers/gpu/drm/panel/panel-himax-hx8394.c            | 11 +++++------
 drivers/gpu/drm/panel/panel-ilitek-ili9322.c          | 10 ++++------
 drivers/gpu/drm/panel/panel-ilitek-ili9341.c          | 10 +++++-----
 drivers/gpu/drm/panel/panel-ilitek-ili9805.c          | 12 ++++++------
 drivers/gpu/drm/panel/panel-ilitek-ili9806e.c         | 10 ++++------
 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c         | 11 +++++------
 drivers/gpu/drm/panel/panel-innolux-ej030na.c         | 11 +++++------
 drivers/gpu/drm/panel/panel-innolux-p079zca.c         | 11 +++++------
 drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c      | 10 ++++------
 drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c          | 10 +++++-----
 drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c    | 11 +++++------
 drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c    | 11 +++++------
 drivers/gpu/drm/panel/panel-lg-lg4573.c               | 11 +++++------
 drivers/gpu/drm/panel/panel-lincolntech-lcd197.c      | 11 +++++------
 drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c   | 11 +++++------
 drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c      | 11 +++++------
 drivers/gpu/drm/panel/panel-newvision-nv3051d.c       | 11 +++++------
 drivers/gpu/drm/panel/panel-newvision-nv3052c.c       | 10 ++++------
 drivers/gpu/drm/panel/panel-novatek-nt35510.c         | 12 ++++++------
 drivers/gpu/drm/panel/panel-novatek-nt35560.c         | 12 ++++++------
 drivers/gpu/drm/panel/panel-novatek-nt35950.c         | 10 ++++------
 drivers/gpu/drm/panel/panel-novatek-nt36523.c         |  9 +++++----
 drivers/gpu/drm/panel/panel-novatek-nt36672e.c        | 10 +++++-----
 drivers/gpu/drm/panel/panel-novatek-nt39016.c         | 10 ++++------
 drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c    | 11 +++++------
 drivers/gpu/drm/panel/panel-orisetech-ota5601a.c      | 11 +++++------
 30 files changed, 145 insertions(+), 174 deletions(-)
---
base-commit: a4b4e3fd536763b3405c70ef97a6e7f9af8a00dc
change-id: 20250520-drivers-mass-convert-part2-1a76098178c3

Best regards,
-- 
Anusha Srivatsa <asriv...@redhat.com>

Reply via email to