[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <2705cf4c0df41f335cbe91bfd9984fcd95208788.1722945487.git.christophe.jaillet@wanadoo.fr>
Date: Tue, 6 Aug 2024 13:59:10 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>
Cc: linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
dri-devel@...ts.freedesktop.org
Subject: [PATCH 1/2] drm/dp_mst: Slightly optimize drm_dp_mst_i2c_write() (1/2)
'txmsg' is memset()'ed in the for loop below, before usage. So we can save
another initialization txmsg when it is allocated.
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
In case of interest, on x86_64, with allmodconfig, sizeof(*txmsg) is 768
bytes.
---
drivers/gpu/drm/display/drm_dp_mst_topology.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
index 379a449a28a2..7bf6157eb3a3 100644
--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
@@ -5886,7 +5886,7 @@ static int drm_dp_mst_i2c_write(struct drm_dp_mst_branch *mstb,
struct drm_dp_sideband_msg_tx *txmsg = NULL;
int ret;
- txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL);
+ txmsg = kmalloc(sizeof(*txmsg), GFP_KERNEL);
if (!txmsg) {
ret = -ENOMEM;
goto out;
--
2.45.2
Powered by blists - more mailing lists