From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754504AbdKMStI convert rfc822-to-8bit (ORCPT ); Mon, 13 Nov 2017 13:49:08 -0500 Received: from muru.com ([72.249.23.125]:48374 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753776AbdKMStG (ORCPT ); Mon, 13 Nov 2017 13:49:06 -0500 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 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20171112182848.li5chdcsrhjv3du6@earth> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Sebastian Reichel [171112 18:30]: > Hi, > > 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(). > > > > Signed-off-by: Pan Bian > > --- > > Reviewed-by: Sebastian Reichel Acked-by: Tony Lindgren