Message ID | 2705cf4c0df41f335cbe91bfd9984fcd95208788.1722945487.git.christophe.jaillet@wanadoo.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/2] drm/dp_mst: Slightly optimize drm_dp_mst_i2c_write() (1/2) | expand |
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;
'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@wanadoo.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(-)