From patchwork Wed Dec 23 10:37:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 7910091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 89C829F318 for ; Wed, 23 Dec 2015 10:41:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C39CB2045B for ; Wed, 23 Dec 2015 10:40:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DDD7C20411 for ; Wed, 23 Dec 2015 10:40:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aBgpd-00075R-NV; Wed, 23 Dec 2015 10:39:45 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aBgpH-0006f9-TY for linux-arm-kernel@lists.infradead.org; Wed, 23 Dec 2015 10:39:25 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NZT00B4C490EEC0@mailout3.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 23 Dec 2015 10:39:00 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-c5-567a79c4bc7d Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 60.82.21385.4C97A765; Wed, 23 Dec 2015 10:39:00 +0000 (GMT) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NZT008TT48PPY50@eusync2.samsung.com>; Wed, 23 Dec 2015 10:39:00 +0000 (GMT) From: Andrzej Hajda To: Linus Walleij , Ray Jui , Scott Branden , Jon Mason Subject: [PATCH] pinctrl: nsp-gpio: fix type of iterator Date: Wed, 23 Dec 2015 11:37:19 +0100 Message-id: <1450867041-729-2-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1450867041-729-1-git-send-email-a.hajda@samsung.com> References: <1450867041-729-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGLMWRmVeSWpSXmKPExsVy+t/xK7pHKqvCDB78EbC4te4cq8XGGetZ Ldb2HmWxeHjA1mLKn+VMFpseX2O12Dz/D6PF5V1z2CzWHrnLbvF05mY2i3ernzA6cHvMun+W zePOtT1sHpuX1Hv0bVnF6PF5k1wAaxSXTUpqTmZZapG+XQJXxtW1VgUn2CvWrD3D2sC4ha2L kZNDQsBEYtazbYwQtpjEhXvrgeJcHEICSxklPn79COU0MUn8PdHEClLFJqAp8XfzTbCEiMBU RonbB5vAHGaBNcwSEw78ZO5i5OAQFrCQ2LolBKSBRUBVouVKGzuIzSvgKLFpbzcrxDo5iZPH JoPZnAJOEl2b74GdIQRUc3LrdsYJjLwLGBlWMYqmliYXFCel5xrpFSfmFpfmpesl5+duYoSE 3tcdjEuPWR1iFOBgVOLhfdFcGSbEmlhWXJl7iFGCg1lJhDf9HVCINyWxsiq1KD++qDQntfgQ ozQHi5I478xd70OEBNITS1KzU1MLUotgskwcnFINjNWF5RM+Fa5OevFu8eTFvw0juOd/Pu6Q c8PSV+bTvyecH+oUOONuLdm7R1k6TvDp1qj7LwTPva5aeFLYWuyQoGeUkdSKDKF9PNbVO8I2 HX90+lb93EsHtPnTzjJu3GHrpe1zZrFB4fYzyZwu/NPZn8XllLnluZZMTW3YEfHsut3WaTY5 G4ItFimxFGckGmoxFxUnAgAz2eQeOQIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151223_023924_288439_E9FF8020 X-CRM114-Status: GOOD ( 14.42 ) X-Spam-Score: -6.9 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:PIN CONTROL SUBSYSTEM" , Bartlomiej Zolnierkiewicz , open list , Andrzej Hajda , bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Iterator i declared as unsigned is always non-negative so the loop will never end. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- drivers/pinctrl/bcm/pinctrl-nsp-gpio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c index 34648f6..ad5b04c 100644 --- a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c +++ b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c @@ -439,7 +439,8 @@ static int nsp_gpio_set_strength(struct nsp_gpio *chip, unsigned gpio, static int nsp_gpio_get_strength(struct nsp_gpio *chip, unsigned gpio, u16 *strength) { - unsigned int i, offset, shift; + unsigned int offset, shift; + int i; u32 val; unsigned long flags;