All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunyou Tang <tangchunyou@163.com>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: gustavoars@kernel.org, sam@ravnborg.org,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, tangchunyou@yulong.com
Subject: Re: [PATCH] drivers/video/fbdev:modify 0 to NULL
Date: Thu, 18 Mar 2021 10:47:18 +0800	[thread overview]
Message-ID: <20210318104718.00005767@163.com> (raw)
In-Reply-To: <20f1664e-df4c-d085-cb25-1d05e8a793a3@embeddedor.com>

HI,Gustavo

On Wed, 17 Mar 2021 20:41:15 -0500
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> On 3/17/21 21:33, ChunyouTang wrote:
> > From: tangchunyou <tangchunyou@yulong.com>
> > 
> > modify 0 to NULL,info is a pointer,it should be
> > 
> > compared with NULL,not 0
> > 
> > Signed-off-by: tangchunyou <tangchunyou@yulong.com>
> > ---
> >  drivers/video/fbdev/offb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
> > index 4501e84..cd1042f 100644
> > --- a/drivers/video/fbdev/offb.c
> > +++ b/drivers/video/fbdev/offb.c
> > @@ -412,7 +412,7 @@ static void __init offb_init_fb(const char
> > *name, 
> >  	info = framebuffer_alloc(sizeof(u32) * 16, NULL);
> >  
> > -	if (info == 0) {
> > +	if (info == NULL) {  
> 
> if (!info) is better.
> 
> --
> Gustavo
> 
> >  		release_mem_region(res_start, res_size);
> >  		return;
> >  	}
> >   

I think "if (info == NULL)" is more intuitive,and there have many
compare likes "if (info == NULL)" in this file.

--
ChunyouTang


WARNING: multiple messages have this Message-ID (diff)
From: Chunyou Tang <tangchunyou@163.com>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: linux-fbdev@vger.kernel.org, sam@ravnborg.org,
	gustavoars@kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, tangchunyou@yulong.com
Subject: Re: [PATCH] drivers/video/fbdev:modify 0 to NULL
Date: Thu, 18 Mar 2021 10:47:18 +0800	[thread overview]
Message-ID: <20210318104718.00005767@163.com> (raw)
In-Reply-To: <20f1664e-df4c-d085-cb25-1d05e8a793a3@embeddedor.com>

HI,Gustavo

On Wed, 17 Mar 2021 20:41:15 -0500
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> On 3/17/21 21:33, ChunyouTang wrote:
> > From: tangchunyou <tangchunyou@yulong.com>
> > 
> > modify 0 to NULL,info is a pointer,it should be
> > 
> > compared with NULL,not 0
> > 
> > Signed-off-by: tangchunyou <tangchunyou@yulong.com>
> > ---
> >  drivers/video/fbdev/offb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
> > index 4501e84..cd1042f 100644
> > --- a/drivers/video/fbdev/offb.c
> > +++ b/drivers/video/fbdev/offb.c
> > @@ -412,7 +412,7 @@ static void __init offb_init_fb(const char
> > *name, 
> >  	info = framebuffer_alloc(sizeof(u32) * 16, NULL);
> >  
> > -	if (info == 0) {
> > +	if (info == NULL) {  
> 
> if (!info) is better.
> 
> --
> Gustavo
> 
> >  		release_mem_region(res_start, res_size);
> >  		return;
> >  	}
> >   

I think "if (info == NULL)" is more intuitive,and there have many
compare likes "if (info == NULL)" in this file.

--
ChunyouTang

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-03-18  2:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18  2:33 [PATCH] drivers/video/fbdev:modify 0 to NULL ChunyouTang
2021-03-18  2:33 ` ChunyouTang
2021-03-18  1:41 ` Gustavo A. R. Silva
2021-03-18  1:41   ` Gustavo A. R. Silva
2021-03-18  2:47   ` Chunyou Tang [this message]
2021-03-18  2:47     ` Chunyou Tang
2021-03-18  1:54     ` Gustavo A. R. Silva
2021-03-18  1:54       ` Gustavo A. R. Silva
2021-03-18  2:56       ` Chunyou Tang
2021-03-18  2:56         ` Chunyou Tang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210318104718.00005767@163.com \
    --to=tangchunyou@163.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo@embeddedor.com \
    --cc=gustavoars@kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=tangchunyou@yulong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.