Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759374AbaDKPrc (ORCPT ); Fri, 11 Apr 2014 11:47:32 -0400 Received: from mail.abilis.ch ([195.70.19.74]:11835 "EHLO mail.abilis.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756936AbaDKPr2 (ORCPT ); Fri, 11 Apr 2014 11:47:28 -0400 X-Greylist: delayed 3655 seconds by postgrey-1.27 at vger.kernel.org; Fri, 11 Apr 2014 11:47:27 EDT From: Christian Ruppert To: Linus Walleij , linux-kernel@vger.kernel.org Cc: Dan Carpenter , devicetree@vger.kernel.org, Christian Ruppert Subject: [PATCH] pinctrl/TB10x: Fix signedness bug Date: Fri, 11 Apr 2014 16:46:04 +0200 Message-Id: <1397227564-8698-1-git-send-email-christian.ruppert@abilis.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <20140402111358.GA23000@mwanda> References: <20140402111358.GA23000@mwanda> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the TB10x pin database, a port index of -1 is used to indicate unmuxed GPIO pin groups. This bug fixes a 'cast to unsigned' bug of this value. Thanks to Dan Carpenter for highlighting this. CC: Dan Carpenter Signed-off-by: Christian Ruppert --- drivers/pinctrl/pinctrl-tb10x.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-tb10x.c b/drivers/pinctrl/pinctrl-tb10x.c index c5e0f69..26ca685 100644 --- a/drivers/pinctrl/pinctrl-tb10x.c +++ b/drivers/pinctrl/pinctrl-tb10x.c @@ -629,9 +629,8 @@ static int tb10x_gpio_request_enable(struct pinctrl_dev *pctl, */ for (i = 0; i < state->pinfuncgrpcnt; i++) { const struct tb10x_pinfuncgrp *pfg = &state->pingroups[i]; - unsigned int port = pfg->port; unsigned int mode = pfg->mode; - int j; + int j, port = pfg->port; /* * Skip pin groups which are always mapped and don't need -- 1.7.1 -- 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/