drm/msm/dpu: drop temp variable from dpu_encoder_phys_cmd_init()
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Thu, 1 Jun 2023 17:22:35 +0000 (20:22 +0300)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Sun, 4 Jun 2023 02:41:47 +0000 (05:41 +0300)
There is no need to assign a result to temp varable just to return it
two lines below. Drop the temporary variable.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Abhinav Kumar <quic_abhinavk@quicinc.com> # sc7280
Patchwork: https://patchwork.freedesktop.org/patch/540637/
Link: https://lore.kernel.org/r/20230601172236.564445-7-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c

index 2cc6b0c..4f8c918 100644 (file)
@@ -756,15 +756,13 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init(
 {
        struct dpu_encoder_phys *phys_enc = NULL;
        struct dpu_encoder_phys_cmd *cmd_enc = NULL;
-       int ret = 0;
 
        DPU_DEBUG("intf\n");
 
        cmd_enc = kzalloc(sizeof(*cmd_enc), GFP_KERNEL);
        if (!cmd_enc) {
-               ret = -ENOMEM;
                DPU_ERROR("failed to allocate\n");
-               return ERR_PTR(ret);
+               return ERR_PTR(-ENOMEM);
        }
        phys_enc = &cmd_enc->base;