From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Pinchart Subject: Re: [PATCH v2 3/4] pinctrl: sh-pfc: Use reg_width instead of reg as sentinel Date: Thu, 12 Mar 2015 03:19:32 +0200 Message-ID: <5151261.qkXBQVcIf9@avalon> References: <1425985583-26279-1-git-send-email-geert+renesas@glider.be> <1425985583-26279-4-git-send-email-geert+renesas@glider.be> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: Received: from galahad.ideasonboard.com ([185.26.127.97]:39613 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751532AbbCLBTp (ORCPT ); Wed, 11 Mar 2015 21:19:45 -0400 In-Reply-To: <1425985583-26279-4-git-send-email-geert+renesas@glider.be> Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Geert Uytterhoeven Cc: Linus Walleij , linux-gpio@vger.kernel.org, linux-sh@vger.kernel.org Hi Geert, Thank you for the patch. On Tuesday 10 March 2015 12:06:22 Geert Uytterhoeven wrote: > All other loops over sh_pfc_soc_info.data_regs[] use > pinmux_data_reg.regwidth as the sentinel, which is safer as zero is > never a valid regwidth value (reg could be zero if we start using it to > store an offset). > > Signed-off-by: Geert Uytterhoeven Acked-by: Laurent Pinchart > --- > v2: > - New. > --- > drivers/pinctrl/sh-pfc/gpio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c > index aa2fc77a1925e839..5d3a35ce09125a45 100644 > --- a/drivers/pinctrl/sh-pfc/gpio.c > +++ b/drivers/pinctrl/sh-pfc/gpio.c > @@ -84,7 +84,7 @@ static void gpio_setup_data_reg(struct sh_pfc_chip *chip, > unsigned idx) unsigned int bit; > unsigned int i; > > - for (i = 0, dreg = pfc->info->data_regs; dreg->reg; ++i, ++dreg) { > + for (i = 0, dreg = pfc->info->data_regs; dreg->reg_width; ++i, ++dreg) { > for (bit = 0; bit < dreg->reg_width; bit++) { > if (dreg->enum_ids[bit] == pin->enum_id) { > gpio_pin->dreg = i; -- Regards, Laurent Pinchart