From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 13 Nov 2017 10:49:03 -0800 From: Tony Lindgren To: Sebastian Reichel Cc: Pan Bian , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Rob Herring , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: adc: cpcap: fix incorrect validation Message-ID: <20171113184903.GX28152@atomide.com> References: <1510502480-27117-1-git-send-email-bianpan2016@163.com> <20171112182848.li5chdcsrhjv3du6@earth> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20171112182848.li5chdcsrhjv3du6@earth> List-ID: * Sebastian Reichel [171112 18:30]: > Hi, >=20 > On Mon, Nov 13, 2017 at 12:01:20AM +0800, Pan Bian wrote: > > Function platform_get_irq_byname() returns a negative error code on > > failure, and a zero or positive number on success. However, in function > > cpcap_adc_probe(), positive IRQ numbers are also taken as error cases. > > Use "if (ddata->irq < 0)" instead of "if (!ddata->irq)" to validate the > > return value of platform_get_irq_byname(). > >=20 > > Signed-off-by: Pan Bian > > --- >=20 > Reviewed-by: Sebastian Reichel Acked-by: Tony Lindgren