Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965255AbbLWLFS (ORCPT ); Wed, 23 Dec 2015 06:05:18 -0500 Received: from pandora.arm.linux.org.uk ([78.32.30.218]:45131 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751315AbbLWLFQ (ORCPT ); Wed, 23 Dec 2015 06:05:16 -0500 Date: Wed, 23 Dec 2015 11:05:00 +0000 From: Russell King - ARM Linux To: Marek Szyprowski Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ulf Hansson , Tomeu Vizoso , Greg Kroah-Hartman , Dan Williams , Kukjin Kim , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: Re: [PATCH v5 2/5] ARM: sa1111: ensure no negative value gets returned on positive match Message-ID: <20151223110500.GQ8644@n2100.arm.linux.org.uk> References: <1450868368-5650-1-git-send-email-m.szyprowski@samsung.com> <1450868368-5650-3-git-send-email-m.szyprowski@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450868368-5650-3-git-send-email-m.szyprowski@samsung.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1644 Lines: 44 On Wed, Dec 23, 2015 at 11:59:25AM +0100, Marek Szyprowski wrote: > This patch ensures that existing bus match callbacks don't return > negative values (which might be interpreted as potential errors in the > future) in case of positive match. This actually can't return a negative number - only valid devid bits are 0 to 9 inclusive, and this isn't going to ever change. So the patch isn't strictly necessary, but is good from the point of view of ensuring consistency. Hence: > Signed-off-by: Marek Szyprowski Acked-by: Russell King > --- > arch/arm/common/sa1111.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c > index 3d22494..fb0a0a4 100644 > --- a/arch/arm/common/sa1111.c > +++ b/arch/arm/common/sa1111.c > @@ -1290,7 +1290,7 @@ static int sa1111_match(struct device *_dev, struct device_driver *_drv) > struct sa1111_dev *dev = SA1111_DEV(_dev); > struct sa1111_driver *drv = SA1111_DRV(_drv); > > - return dev->devid & drv->devid; > + return !!(dev->devid & drv->devid); > } > > static int sa1111_bus_suspend(struct device *dev, pm_message_t state) > -- > 1.9.2 > -- RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/