diff mbox series

drm/kmb: Remove an unnecessary NULL check

Message ID 20201117072137.GB1111239@mwanda (mailing list archive)
State New, archived
Headers show
Series drm/kmb: Remove an unnecessary NULL check | expand

Commit Message

Dan Carpenter Nov. 17, 2020, 7:21 a.m. UTC
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@oracle.com>
---
 drivers/gpu/drm/kmb/kmb_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chrisanthus, Anitha Nov. 20, 2020, 1:19 a.m. UTC | #1
Looks good to me.

Anitha

> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@oracle.com>
> Sent: Monday, November 16, 2020 11:22 PM
> To: Chrisanthus, Anitha <anitha.chrisanthus@intel.com>
> Cc: Dea, Edmund J <edmund.j.dea@intel.com>; David Airlie <airlied@linux.ie>;
> Daniel Vetter <daniel@ffwll.ch>; dri-devel@lists.freedesktop.org; kernel-
> janitors@vger.kernel.org
> 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@oracle.com>
> ---
>  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
Sam Ravnborg Nov. 20, 2020, 8:21 a.m. UTC | #2
Hi Anitha.

On Fri, Nov 20, 2020 at 01:19:06AM +0000, Chrisanthus, Anitha wrote:
> Looks good to me.

Can we get either an "Acked-by:" or "Reviewed-by:"?
Then we can use this while applying.

Any news on gettting commit access yourself?
If not, then try to ping on the open ticket.


	Sam
Thomas Zimmermann Nov. 20, 2020, 8:34 a.m. UTC | #3
Hi

Am 20.11.20 um 09:21 schrieb Sam Ravnborg:
> Hi Anitha.
> 
> On Fri, Nov 20, 2020 at 01:19:06AM +0000, Chrisanthus, Anitha wrote:
>> Looks good to me.
> 
> Can we get either an "Acked-by:" or "Reviewed-by:"?
> Then we can use this while applying.
> 
> Any news on gettting commit access yourself?
> If not, then try to ping on the open ticket.

It's been acked a while ago. I sent out a reminder to Daniel Stone.

Best regards
Thomas

> 
> 
> 	Sam
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
Chrisanthus, Anitha Nov. 20, 2020, 5:28 p.m. UTC | #4
> -----Original Message-----
> From: Thomas Zimmermann <tzimmermann@suse.de>
> Sent: Friday, November 20, 2020 12:34 AM
> To: Sam Ravnborg <sam@ravnborg.org>; Chrisanthus, Anitha
> <anitha.chrisanthus@intel.com>
> Cc: David Airlie <airlied@linux.ie>; Dea, Edmund J <edmund.j.dea@intel.com>;
> kernel-janitors@vger.kernel.org; dri-devel@lists.freedesktop.org; Dan
> Carpenter <dan.carpenter@oracle.com>
> Subject: Re: [PATCH] drm/kmb: Remove an unnecessary NULL check
> 
> Hi
> 
> Am 20.11.20 um 09:21 schrieb Sam Ravnborg:
> > Hi Anitha.
> >
> > On Fri, Nov 20, 2020 at 01:19:06AM +0000, Chrisanthus, Anitha wrote:
> >> Looks good to me.
> >
> > Can we get either an "Acked-by:" or "Reviewed-by:"?
> > Then we can use this while applying.
Sorry, forgot that.
Reviewed-by: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
> >
> > Any news on gettting commit access yourself?
> > If not, then try to ping on the open ticket.
> 
> It's been acked a while ago. I sent out a reminder to Daniel Stone.
I did get access today, thank you! I will have to get familiar with dim and the whole process before I start pushing patches.
> 
> Best regards
> Thomas
> 
> >
> >
> > 	Sam
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
> 
> --
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Maxfeldstr. 5, 90409 Nürnberg, Germany
> (HRB 36809, AG Nürnberg)
> Geschäftsführer: Felix Imendörffer
Sam Ravnborg Nov. 29, 2020, 10:04 p.m. UTC | #5
Hi Anitha,

On Fri, Nov 20, 2020 at 05:28:59PM +0000, Chrisanthus, Anitha wrote:
> 
> 
> > -----Original Message-----
> > From: Thomas Zimmermann <tzimmermann@suse.de>
> > Sent: Friday, November 20, 2020 12:34 AM
> > To: Sam Ravnborg <sam@ravnborg.org>; Chrisanthus, Anitha
> > <anitha.chrisanthus@intel.com>
> > Cc: David Airlie <airlied@linux.ie>; Dea, Edmund J <edmund.j.dea@intel.com>;
> > kernel-janitors@vger.kernel.org; dri-devel@lists.freedesktop.org; Dan
> > Carpenter <dan.carpenter@oracle.com>
> > Subject: Re: [PATCH] drm/kmb: Remove an unnecessary NULL check
> > 
> > Hi
> > 
> > Am 20.11.20 um 09:21 schrieb Sam Ravnborg:
> > > Hi Anitha.
> > >
> > > On Fri, Nov 20, 2020 at 01:19:06AM +0000, Chrisanthus, Anitha wrote:
> > >> Looks good to me.
> > >
> > > Can we get either an "Acked-by:" or "Reviewed-by:"?
> > > Then we can use this while applying.
> Sorry, forgot that.
> Reviewed-by: Anitha Chrisanthus <anitha.chrisanthus@intel.com>

Thanks, patch is now pushed to drm-misc-next.

	Sam
diff mbox series

Patch

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);