From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F1491465B4 for ; Fri, 30 May 2025 02:50:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748573402; cv=none; b=kkxTbdPT+D8p2vuW2CzP2S5Q3/WKj2JX8fCD+1xFn2ycebyClWyciSUCrjvlrsW4whebfL1pqzN41ZDU7BgNUG3bTk5MQ0kabRrCjWn7t0V9aFS2TN5kaIkW9I3F6GXp7vh6mkZo2TsqKJp0LdNPOnY/PE+q+QJAKtcKFlOtyJQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748573402; c=relaxed/simple; bh=n9YY7Ks+BsQhMLk8ELZDMHBzVjCqSp2b4F0mzbdlpYQ=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=RnaCUWAHoLQHwAF/PxU/zE9ljcB1sMUfFBhGENvikGm4EhmglnBuawAHRL1+3PeqnjBnH1Ymw0F1KR66jb272rsTkQorFROkrrBvQkH+dAqRSpWuhziRGH5p5e5iw3k6N9+PKtyRrKSWjhXcF5Qk+4jojEUDFeVNzO+wBZKEkcQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cMsGG/bh; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cMsGG/bh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748573399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Np3+JP9+IZ9e/OLAgG6uGAkpVocBLgLmLnRA5pQUsnQ=; b=cMsGG/bhUIKBIZ5RcrgrxwY0xEguC5LWMBx4+RNiQsZoDdB2M/ZQDKh8bMI6Mp8/O2gx3q 0P8cJzJnNI+W0FczR5l4+7QOK5ClHVTxHE/BfegpN/bFx2o2YusUUU32aO9p50tGWKbS8l GJtEpgPBUvyq2rXuWuLAUoGPY43KYJQ= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-650-zH4ZdSr-ML2Jd_p4faXBAA-1; Thu, 29 May 2025 22:49:55 -0400 X-MC-Unique: zH4ZdSr-ML2Jd_p4faXBAA-1 X-Mimecast-MFC-AGG-ID: zH4ZdSr-ML2Jd_p4faXBAA_1748573392 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3E6901956088; Fri, 30 May 2025 02:49:51 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.97]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 53C281955D82; Fri, 30 May 2025 02:49:44 +0000 (UTC) From: Anusha Srivatsa Subject: [PATCH v2 00/46] drm/panel: Use refcounted allocation in place of devm_kzalloc() - Part3 Date: Thu, 29 May 2025 21:46:02 -0500 Message-Id: <20250529-b4-drm_panel_mass_driver_convert_part3-v2-0-5d75a3711e40@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAOsbOWgC/42NQQqDMBREryJZNyVGI7Wr3qNISMy3fqiJ/ITQI t69qdB9V8ObgXkbi0AIkV2rjRFkjBh8AXmq2Dgb/wCOrjCTQirRCsltyx0tejUennoxMWpHmIH 0GHyJVBZKDe+t6OzUu8ZKycrZSjDh6xDdh8IzxhTofXhz/W1/iuZfRa654H2nbK2MU/YCNwI3m 3Qew8KGfd8/vMrVa90AAAA= X-Change-ID: 20250402-b4-drm_panel_mass_driver_convert_part3-9b06bf9d3b22 To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Robert Chiras , Linus Walleij , Markuss Broks , Artur Weber , Dzmitry Sankouski , Jagan Teki , =?utf-8?q?Guido_G=C3=BCnther?= , Purism Kernel Team , Ondrej Jirman , Sasha Finkelstein , Janne Grunau , Michael Trimarchi , Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1748573168; l=9402; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=n9YY7Ks+BsQhMLk8ELZDMHBzVjCqSp2b4F0mzbdlpYQ=; b=urUoLqE+7N9HZju7OdqSeE+4maKM/2/MCPBTR8dV5Hq4CO88dOCV00rMdMC1AaqNX4TjsyuoO kE9jxLDAcIbA8IeNbUMpCN5yqJfa9P28iKkXtjXxlPWjqXprgrTQCIR X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Final set of drivers to use the new 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. Very minor changes in this version - refactors, alignment fixes. With all drivers converted, next chunk of work is to add get() and put() to drm_panel_add() and drm_panel_remove(). First 2 parts already merged. Part 1 of the conversion : https://patchwork.freedesktop.org/series/147082/ Part 2 of the conversion : https://patchwork.freedesktop.org/series/147157/ Signed-off-by: Anusha Srivatsa --- Changes in v2: - simple refactors, if dev is already dereferenced use it (patch 8, 9, 21, 32) - fix alignment in 2 patches (patch 40 and 41) - Use the right connector in patch 23 - Link to v1: https://lore.kernel.org/r/20250403-b4-drm_panel_mass_driver_convert_part3-v1-0-965b15ad5b8e@redhat.com --- Anusha Srivatsa (46): panel/orisetech-otm8009a: Use refcounted allocation in place of devm_kzalloc() panel/raydium-rm67191: Use refcounted allocation in place of devm_kzalloc() panel/raydium-rm67200: Use refcounted allocation in place of devm_kzalloc() panel/raydium-rm68200: Use refcounted allocation in place of devm_kzalloc() panel/raydium-rm692e5: Use refcounted allocation in place of devm_kzalloc() panel/raydium-rm69380: Use refcounted allocation in place of devm_kzalloc() panel/ronbo-rb070d30: Use refcounted allocation in place of devm_kzalloc() panel/samsung-ams581vf01: Use refcounted allocation in place of devm_kzalloc() panel/samsung-ams639rq08: Use refcounted allocation in place of devm_kzalloc() panel/samsung-atna33xc20: Use refcounted allocation in place of devm_kzalloc() panel/samsung-db7430: Use refcounted allocation in place of devm_kzalloc() panel/samsung-ld9040: Use refcounted allocation in place of devm_kzalloc() panel/samsung-s6d16d0: Use refcounted allocation in place of devm_kzalloc() panel/samsung-s6d27a1: Use refcounted allocation in place of devm_kzalloc() panel/samsung-s6d7aa0: Use refcounted allocation in place of devm_kzalloc() panel/samsung-s6e3fa7: Use refcounted allocation in place of devm_kzalloc() panel/samsung-s6e3ha2: Use refcounted allocation in place of devm_kzalloc() panel/samsung-s6e3ha8: Use refcounted allocation in place of devm_kzalloc() panel/samsung-s6e63j0x03: Use refcounted allocation in place of devm_kzalloc() panel/s6e88a0-ams427ap24: Use refcounted allocation in place of devm_kzalloc() panel/samsung-s6e8aa0: Use refcounted allocation in place of devm_kzalloc() panel/samsung-sofef00: Use refcounted allocation in place of devm_kzalloc() panel/seiko-43wvf1g: Use refcounted allocation in place of devm_kzalloc() panel/sharp-ls037v7dw01: Use refcounted allocation in place of devm_kzalloc() panel/sharp-ls060t1sx01: Use refcounted allocation in place of devm_kzalloc() panel/sitronix-st7701: Use refcounted allocation in place of devm_kzalloc() panel/sitronix-st7703: Use refcounted allocation in place of devm_kzalloc() panel/sitronix-st7789v: Use refcounted allocation in place of devm_kzalloc() panel/sony-acx565akm: Use refcounted allocation in place of devm_kzalloc() panel/sony-td4353-jdi: Use refcounted allocation in place of devm_kzalloc() panel/truly-nt35521: Use refcounted allocation in place of devm_kzalloc() panel/panel-summit: Use refcounted allocation in place of devm_kzalloc() panel/synaptics-r63353: allocation in place of devm_kzalloc() panel/tpo-td028ttec1: Use refcounted allocation in place of devm_kzalloc() panel/tpo-td043mtea1: Use refcounted allocation in place of devm_kzalloc() panel/tpo-tpg110: Use refcounted allocation in place of devm_kzalloc() panel/visionox-r66451: Use refcounted allocation in place of devm_kzalloc() panel/visionox-rm69299: Use refcounted allocation in place of devm_kzalloc() panel/visionox-rm692e5.c: Use refcounted allocation in place of devm_kzalloc() panel/visionox-vtdr6130: Use refcounted allocation in place of devm_kzalloc() panel/widechips-ws2401: Use refcounted allocation in place of devm_kzalloc() panel/xinpeng-xpp055c272: Use refcounted allocation in place of devm_kzalloc() panel/s6e88a0-ams452ef01: Use refcounted allocation in place of devm_kzalloc() panel/nec-nl8048hl11: Use refcounted allocation in place of devm_kzalloc() panel/panel-lvds: Use refcounted allocation in place of devm_kzalloc() panel/lg-lb035q02: Use refcounted allocation in place of devm_kzalloc() drivers/gpu/drm/panel/panel-lg-lb035q02.c | 10 ++++------ drivers/gpu/drm/panel/panel-lvds.c | 12 +++++------- drivers/gpu/drm/panel/panel-nec-nl8048hl11.c | 10 ++++------ drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 11 +++++------ drivers/gpu/drm/panel/panel-raydium-rm67191.c | 10 +++++----- drivers/gpu/drm/panel/panel-raydium-rm67200.c | 11 +++++------ drivers/gpu/drm/panel/panel-raydium-rm68200.c | 11 +++++------ drivers/gpu/drm/panel/panel-raydium-rm692e5.c | 10 +++++----- drivers/gpu/drm/panel/panel-raydium-rm69380.c | 10 +++++----- drivers/gpu/drm/panel/panel-ronbo-rb070d30.c | 11 +++++------ drivers/gpu/drm/panel/panel-samsung-ams581vf01.c | 10 +++++----- drivers/gpu/drm/panel/panel-samsung-ams639rq08.c | 10 +++++----- drivers/gpu/drm/panel/panel-samsung-atna33xc20.c | 11 ++++++----- drivers/gpu/drm/panel/panel-samsung-db7430.c | 11 +++++------ drivers/gpu/drm/panel/panel-samsung-ld9040.c | 11 +++++------ drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 11 +++++------ drivers/gpu/drm/panel/panel-samsung-s6d27a1.c | 11 +++++------ drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c | 10 +++++----- drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c | 10 +++++----- drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 10 +++++----- drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c | 10 +++++----- drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c | 10 +++++----- drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c | 10 +++++----- drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams452ef01.c | 11 +++++------ drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c | 10 +++++----- drivers/gpu/drm/panel/panel-samsung-sofef00.c | 11 +++++------ drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 11 +++++------ drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c | 10 ++++------ drivers/gpu/drm/panel/panel-sharp-ls060t1sx01.c | 11 +++++------ drivers/gpu/drm/panel/panel-sitronix-st7701.c | 8 ++++---- drivers/gpu/drm/panel/panel-sitronix-st7703.c | 11 +++++------ drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 10 ++++------ drivers/gpu/drm/panel/panel-sony-acx565akm.c | 10 ++++------ drivers/gpu/drm/panel/panel-sony-td4353-jdi.c | 11 +++++------ drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c | 11 +++++------ drivers/gpu/drm/panel/panel-summit.c | 10 +++++----- drivers/gpu/drm/panel/panel-synaptics-r63353.c | 11 +++++------ drivers/gpu/drm/panel/panel-tpo-td028ttec1.c | 11 +++++------ drivers/gpu/drm/panel/panel-tpo-td043mtea1.c | 10 ++++------ drivers/gpu/drm/panel/panel-tpo-tpg110.c | 11 +++++------ drivers/gpu/drm/panel/panel-visionox-r66451.c | 9 +++++---- drivers/gpu/drm/panel/panel-visionox-rm69299.c | 10 +++++----- drivers/gpu/drm/panel/panel-visionox-rm692e5.c | 10 +++++----- drivers/gpu/drm/panel/panel-visionox-vtdr6130.c | 11 +++++------ drivers/gpu/drm/panel/panel-widechips-ws2401.c | 11 +++++------ drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c | 10 ++++------ 46 files changed, 223 insertions(+), 257 deletions(-) --- base-commit: ef818481d9fbaf3483dde0d1faa565a016810de3 change-id: 20250402-b4-drm_panel_mass_driver_convert_part3-9b06bf9d3b22 Best regards, -- Anusha Srivatsa