RE: [PATCH] drm/kmb: Remove an unnecessary NULL check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks good to me.

Anitha

> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Sent: Monday, November 16, 2020 11:22 PM
> To: Chrisanthus, Anitha <anitha.chrisanthus@xxxxxxxxx>
> Cc: Dea, Edmund J <edmund.j.dea@xxxxxxxxx>; David Airlie <airlied@xxxxxxxx>;
> Daniel Vetter <daniel@xxxxxxxx>; dri-devel@xxxxxxxxxxxxxxxxxxxxx; kernel-
> janitors@xxxxxxxxxxxxxxx
> Subject: [PATCH] drm/kmb: Remove an unnecessary NULL check
> 
> The NULL checking isn't done consistently in this function and it leads
> to a static checker warning:
> 
>     drivers/gpu/drm/kmb/kmb_drv.c:561 kmb_pm_suspend()
>     error: we previously assumed 'drm' could be null (see line 559)
> 
> Fortunately "drm" cannot be NULL at this point so the check can just be
> removed.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
>  drivers/gpu/drm/kmb/kmb_drv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/kmb/kmb_drv.c
> b/drivers/gpu/drm/kmb/kmb_drv.c
> index 8c43b136765c..5ff392644603 100644
> --- a/drivers/gpu/drm/kmb/kmb_drv.c
> +++ b/drivers/gpu/drm/kmb/kmb_drv.c
> @@ -557,7 +557,7 @@ MODULE_DEVICE_TABLE(of, kmb_of_match);
>  static int __maybe_unused kmb_pm_suspend(struct device *dev)
>  {
>  	struct drm_device *drm = dev_get_drvdata(dev);
> -	struct kmb_drm_private *kmb = drm ? to_kmb(drm) : NULL;
> +	struct kmb_drm_private *kmb = to_kmb(drm);
> 
>  	drm_kms_helper_poll_disable(drm);
> 
> --
> 2.28.0





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux