drm/msm: Remove unnecessary NULL values
authorRuan Jinjie <ruanjinjie@huawei.com>
Wed, 9 Aug 2023 03:44:41 +0000 (11:44 +0800)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Mon, 9 Oct 2023 09:17:45 +0000 (12:17 +0300)
The NULL initialization of the pointers assigned by kzalloc() first is
not necessary, because if the kzalloc() failed, the pointers will be
assigned NULL, otherwise it works as usual. so remove it.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/551872/
Link: https://lore.kernel.org/r/20230809034445.434902-4-ruanjinjie@huawei.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c

index 8ce7586e2ddf74978a5afd3ab468184282d04583..3c475f8042b037cb199db7faeffe232bf0aefb3c 100644 (file)
@@ -1466,7 +1466,7 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
        struct msm_drm_private *priv = dev->dev_private;
        struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms);
        struct drm_crtc *crtc = NULL;
-       struct dpu_crtc *dpu_crtc = NULL;
+       struct dpu_crtc *dpu_crtc;
        int i, ret;
 
        dpu_crtc = kzalloc(sizeof(*dpu_crtc), GFP_KERNEL);
index 56a3063545ec467a8313844da8bb41e2f3435461..b68682c1b5bcfaf1500b3bb8b245b2c0539a45f8 100644 (file)
@@ -379,7 +379,7 @@ struct mdp5_smp *mdp5_smp_init(struct mdp5_kms *mdp5_kms, const struct mdp5_smp_
 {
        struct mdp5_smp_state *state;
        struct mdp5_global_state *global_state;
-       struct mdp5_smp *smp = NULL;
+       struct mdp5_smp *smp;
        int ret;
 
        smp = kzalloc(sizeof(*smp), GFP_KERNEL);