lkml.org 
[lkml]   [2021]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: [PATCH] media: atomisp: silence "dubious: !x | !y" warning
On Sat, Apr 17, 2021 at 08:56:13PM +0200, Mauro Carvalho Chehab wrote:
> Em Sat, 17 Apr 2021 21:06:27 +0530
> Ashish Kalra <eashishkalra@gmail.com> escreveu:
>
> > Upon running sparse, "warning: dubious: !x | !y" is brought to notice
> > for this file. Logical and bitwise OR are basically the same in this
> > context so it doesn't cause a runtime bug. But let's change it to
> > logical OR to make it cleaner and silence the Sparse warning.
> >
> > Signed-off-by: Ashish Kalra <eashishkalra@gmail.com>
> > ---
> > .../media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
> > index 358cb7d2cd4c..3b850bb2d39d 100644
> > --- a/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
> > +++ b/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
> > @@ -58,7 +58,7 @@ sh_css_vf_downscale_log2(
> > unsigned int ds_log2 = 0;
> > unsigned int out_width;
> >
> > - if ((!out_info) | (!vf_info))
> > + if ((!out_info) || (!vf_info))
>
>
> While here, please get rid of the unneeded parenthesis:
>
> if (!out_info || !vf_info)
>
>
> > return -EINVAL;
> >
> > out_width = out_info->res.width;
>
>
>
> Thanks,
> Mauro
Updated Patch as per your feedback

Thanks
Ashish
From 770317157c3a7abf2fda1d71b0bd651c33bf0bfa Mon Sep 17 00:00:00 2001
From: Ashish Kalra <eashishkalra@gmail.com>
Date: Sun, 18 Apr 2021 06:52:03 +0530
Subject: [PATCH] media: atomisp: silence "dubious: !x | !y" warning

Upon running sparse, "warning: dubious: !x | !y" is brought to notice
for this file. Logical and bitwise OR are basically the same in this
context so it doesn't cause a runtime bug. But let's change it to
logical OR to make it cleaner and silence the Sparse warning.

Signed-off-by: Ashish Kalra <eashishkalra@gmail.com>
---
.../media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
index 358cb7d2cd4c..71c3e7dac052 100644
--- a/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
+++ b/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
@@ -58,7 +58,7 @@ sh_css_vf_downscale_log2(
unsigned int ds_log2 = 0;
unsigned int out_width;

- if ((!out_info) | (!vf_info))
+ if (!out_info || !vf_info)
return -EINVAL;

out_width = out_info->res.width;
--
2.25.1
\
 
 \ /
  Last update: 2021-04-18 03:27    [W:0.874 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site