From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool Date: Fri, 14 Jul 2017 14:27:19 +0200 Message-ID: References: <20170714092540.1217397-1-arnd@arndb.de> <20170714093938.1469319-1-arnd@arndb.de> <20170714120512.ioe67nnloqivtbr7@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <20170714120512.ioe67nnloqivtbr7@mwanda> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Dan Carpenter Cc: devel@driverdev.osuosl.org, Linux-Renesas , Linux Media Mailing List , Greg Kroah-Hartman , Daeseok Youn , Linus Torvalds , Linux Kernel Mailing List , dri-devel , adi-buildroot-devel@lists.sourceforge.net, Hans Verkuil , IDE-ML , Guenter Roeck , =?UTF-8?Q?Niklas_S=C3=B6derlund?= , Tejun Heo , Andrew Morton , Mauro Carvalho Chehab , Robert Jarzmik , Linux ARM , Alan Cox List-Id: linux-ide@vger.kernel.org T24gRnJpLCBKdWwgMTQsIDIwMTcgYXQgMjowNSBQTSwgRGFuIENhcnBlbnRlciA8ZGFuLmNhcnBl bnRlckBvcmFjbGUuY29tPiB3cm90ZToKPiBDaGFuZ2luZzoKPgo+IC0gaWYgKCFmcm9iKCkpIHsK PiArIGlmIChmcm9iKCkgPT0gMCkgewo+Cj4gaXMgYSB0b3RhbGx5IHBvaW50bGVzcyBjaGFuZ2Uu ICBUaGV5J3JlIGJvdGggYmFkLCBiZWNhdXNlIHRoZXkncmUgZG9pbmcKPiBzdWNjZXNzIHRlc3Rp bmcgaW5zdGVhZCBvZiBmYWlsdXJlIHRlc3RpbmcsIGJ1dCBwcm9iYWJseSB0aGUgc2Vjb25kIG9u ZQo+IGlzIHNsaWdodGx5IHdvcnNlLgo+Cj4gVGhpcyB3YXJuaW5nIHNlZ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kIGZvciBhIG5ldyB3YXJu aW5nLgoKSSBhZ3JlZSB0aGF0IG1vc3Qgb2YgdGhlIGZhbHNlIHBvc2l0aXZlcyBhcmUgcmVhbGx5 IGR1bWIgdGhvdWdoLgoKICAgICAgIEFybmQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX18KZHJpLWRldmVsIG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMu ZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlzdHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlz dGluZm8vZHJpLWRldmVsCg== From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754053AbdGNM1d (ORCPT ); Fri, 14 Jul 2017 08:27:33 -0400 Received: from mail-oi0-f51.google.com ([209.85.218.51]:36855 "EHLO mail-oi0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753984AbdGNM1b (ORCPT ); Fri, 14 Jul 2017 08:27:31 -0400 MIME-Version: 1.0 In-Reply-To: <20170714120512.ioe67nnloqivtbr7@mwanda> References: <20170714092540.1217397-1-arnd@arndb.de> <20170714093938.1469319-1-arnd@arndb.de> <20170714120512.ioe67nnloqivtbr7@mwanda> From: Arnd Bergmann Date: Fri, 14 Jul 2017 14:27:19 +0200 X-Google-Sender-Auth: HEVaKJvtwtkxIrjM0HtRxF0BVoU Message-ID: Subject: Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool To: Dan Carpenter Cc: Linux Kernel Mailing List , Mauro Carvalho Chehab , Hans Verkuil , devel@driverdev.osuosl.org, =?UTF-8?Q?Niklas_S=C3=B6derlund?= , Greg Kroah-Hartman , Robert Jarzmik , adi-buildroot-devel@lists.sourceforge.net, dri-devel , Linux-Renesas , IDE-ML , Linux ARM , Tejun Heo , Andrew Morton , Alan Cox , Linus Torvalds , Daeseok Youn , Guenter Roeck , Linux Media Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 14, 2017 at 2:05 PM, Dan Carpenter wrote: > Changing: > > - if (!frob()) { > + if (frob() == 0) { > > is a totally pointless change. They're both bad, because they're doing > success testing instead of failure testing, but probably the second one > is slightly worse. > > This warning seems dumb. I can't imagine it has even a 10% success rate > at finding real bugs. Just disable it. > > Changing the code to propagate error codes, is the right thing of course > so long as it doesn't introduce bugs. It found a two of bugs that I fixed earlier: f0e8faa7a5e8 ("ARM: ux500: fix prcmu_is_cpu_in_wfi() calculation") af15769ffab1 ("scsi: mvsas: fix command_active typo") plus three patches from this series: 1. staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read 2. isdn: isdnloop: suppress a gcc-7 warning (my patch is wrong, as Joe pointed out there is a real bug) 3. drm/vmwgfx: avoid gcc-7 parentheses (here, Linus had a better analysis of the problem, so we should consider that a bug as well) I would estimate around 25% success rate here, which isn't that bad for a new warning. I agree that most of the false positives are really dumb though. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Fri, 14 Jul 2017 14:27:19 +0200 Subject: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool In-Reply-To: <20170714120512.ioe67nnloqivtbr7@mwanda> References: <20170714092540.1217397-1-arnd@arndb.de> <20170714093938.1469319-1-arnd@arndb.de> <20170714120512.ioe67nnloqivtbr7@mwanda> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Jul 14, 2017 at 2:05 PM, Dan Carpenter wrote: > Changing: > > - if (!frob()) { > + if (frob() == 0) { > > is a totally pointless change. They're both bad, because they're doing > success testing instead of failure testing, but probably the second one > is slightly worse. > > This warning seems dumb. I can't imagine it has even a 10% success rate > at finding real bugs. Just disable it. > > Changing the code to propagate error codes, is the right thing of course > so long as it doesn't introduce bugs. It found a two of bugs that I fixed earlier: f0e8faa7a5e8 ("ARM: ux500: fix prcmu_is_cpu_in_wfi() calculation") af15769ffab1 ("scsi: mvsas: fix command_active typo") plus three patches from this series: 1. staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read 2. isdn: isdnloop: suppress a gcc-7 warning (my patch is wrong, as Joe pointed out there is a real bug) 3. drm/vmwgfx: avoid gcc-7 parentheses (here, Linus had a better analysis of the problem, so we should consider that a bug as well) I would estimate around 25% success rate here, which isn't that bad for a new warning. I agree that most of the false positives are really dumb though. Arnd