[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210318104718.00005767@163.com>
Date: Thu, 18 Mar 2021 10:47:18 +0800
From: Chunyou Tang <tangchunyou@....com>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc: gustavoars@...nel.org, sam@...nborg.org,
dri-devel@...ts.freedesktop.org, linux-fbdev@...r.kernel.org,
linux-kernel@...r.kernel.org, tangchunyou@...ong.com
Subject: Re: [PATCH] drivers/video/fbdev:modify 0 to NULL
HI,Gustavo
On Wed, 17 Mar 2021 20:41:15 -0500
"Gustavo A. R. Silva" <gustavo@...eddedor.com> wrote:
> On 3/17/21 21:33, ChunyouTang wrote:
> > From: tangchunyou <tangchunyou@...ong.com>
> >
> > modify 0 to NULL,info is a pointer,it should be
> >
> > compared with NULL,not 0
> >
> > Signed-off-by: tangchunyou <tangchunyou@...ong.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
Powered by blists - more mailing lists