Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1339980pxb; Sat, 17 Apr 2021 14:39:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxUFLco4ioy2SXDvYBCqHIu2j7Jh/uzS8lEN9Rvgp20hBIPxn6aTAxkoQMmnKR1eU/OZtJ X-Received: by 2002:a17:906:f1d0:: with SMTP id gx16mr14653926ejb.340.1618695555512; Sat, 17 Apr 2021 14:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618695555; cv=none; d=google.com; s=arc-20160816; b=eML4pGfrjVX3vM6yR2RIZu+hf83wAA7LqdusEfLxvGu1gNGZMQdccAnSsObM1GG759 YqkPW1If1EqY9xG0MG7eiTONmvsWhHnmrfSJ2v8duJOjr5B7zbWJ3nlucB0LpSXzDOr6 UAvTS+vr33S9j9DcAjt/zjmPCk3bWybAecHrjO+gGpXBOYZrOsQv3VDyqGVHoxdMp55V OPfQBIS5A25XAFRXbiwHTiC30X58uDsEwSjR06cxfiAHxi4Tx356O/rpMCzBTvI4cycK LT6pf/mRoSB45aGr73Yn5qBrohCrL+zfKjdaweZs5C7jkH7UsOunxBQ69uu49V0MYC1c YJTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=pO29GrtiJiIAPcKX/9J5SnZcsWdj74hGcSw52mXukaU=; b=j9tRhQOxuoydLcbYg4QZA3SH5KpfJcegdygsTUaIEDOEdnsa47npni4rd9cUWMorpp H6P777pV8ut2lUIdIV1hJ6M3RJc7mKNEWLVtiWJKkvzPRNu959joXsIoLWbNShNA6xJT wkjks27S1v3sI3FxeBf4mDgzfHaOUytiH0TrbExWeznYY0AZpyF8NydnaApbMfOxT0it tvdeRKqdOc4bonYLmUbvettahrZxSc3WRn2TdwgQDLJqNYT6eJ+yEamkg94dzej7QZru hHUTXowskE32IOvjXBPHknehuPlOujCv068dX/jsYTYauN1OfcfrVxt7LarxeDBajKeT swAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si7622939ejz.607.2021.04.17.14.38.52; Sat, 17 Apr 2021 14:39:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237144AbhDQVcD convert rfc822-to-8bit (ORCPT + 99 others); Sat, 17 Apr 2021 17:32:03 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]:53322 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237101AbhDQVcC (ORCPT ); Sat, 17 Apr 2021 17:32:02 -0400 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-220-berY7wNPPR-CGAsjwcAdkw-1; Sat, 17 Apr 2021 22:31:33 +0100 X-MC-Unique: berY7wNPPR-CGAsjwcAdkw-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 17 Apr 2021 22:31:32 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.015; Sat, 17 Apr 2021 22:31:32 +0100 From: David Laight To: 'Mauro Carvalho Chehab' , Ashish Kalra CC: Sakari Ailus , Greg Kroah-Hartman , "linux-media@vger.kernel.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] media: atomisp: silence "dubious: !x | !y" warning Thread-Topic: [PATCH] media: atomisp: silence "dubious: !x | !y" warning Thread-Index: AQHXM7teiyJWcTifxUyFg0sAh0Hgi6q5OhAg Date: Sat, 17 Apr 2021 21:31:32 +0000 Message-ID: <509f019decae433cab6cb367cdfa6fa9@AcuMS.aculab.com> References: <20210417153627.GA50228@ashish-NUC8i5BEH> <20210417205613.5c1aac74@coco.lan> In-Reply-To: <20210417205613.5c1aac74@coco.lan> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mauro Carvalho Chehab > Sent: 17 April 2021 19:56 > > Em Sat, 17 Apr 2021 21:06:27 +0530 > Ashish Kalra 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. The old code is very likely to by slightly more efficient. It may not matter here, but it might in a really hot path. Since !x | !y and !x || !y always have the same value why is sparse complaining at all. David > > > > Signed-off-by: Ashish Kalra > > --- > > .../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 - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)