linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/2] pinctrl: tegra-xusb: fix an off by one test
@ 2014-07-31 15:22 Dan Carpenter
  2014-07-31 15:34 ` Stephen Warren
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dan Carpenter @ 2014-07-31 15:22 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Linus Walleij, Thierry Reding, Grant Likely, Rob Herring,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

This shoudld be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".

Fixes: dc0a39386687 ('pinctrl: Add NVIDIA Tegra XUSB pad controller support')
Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

diff --git a/drivers/pinctrl/pinctrl-tegra-xusb.c b/drivers/pinctrl/pinctrl-tegra-xusb.c
index a066204..419a047 100644
--- a/drivers/pinctrl/pinctrl-tegra-xusb.c
+++ b/drivers/pinctrl/pinctrl-tegra-xusb.c
@@ -680,7 +680,7 @@ static struct phy *tegra_xusb_padctl_xlate(struct device *dev,
 	if (args->args_count <= 0)
 		return ERR_PTR(-EINVAL);
 
-	if (index > ARRAY_SIZE(padctl->phys))
+	if (index >= ARRAY_SIZE(padctl->phys))
 		return ERR_PTR(-EINVAL);
 
 	return padctl->phys[index];

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [patch 1/2] pinctrl: tegra-xusb: fix an off by one test
  2014-07-31 15:22 [patch 1/2] pinctrl: tegra-xusb: fix an off by one test Dan Carpenter
@ 2014-07-31 15:34 ` Stephen Warren
  2014-08-11  6:56   ` Linus Walleij
  2014-07-31 15:36 ` Thierry Reding
  2014-08-11  6:55 ` Linus Walleij
  2 siblings, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2014-07-31 15:34 UTC (permalink / raw)
  To: Dan Carpenter, Linus Walleij
  Cc: Thierry Reding, Grant Likely, Rob Herring, linux-tegra,
	kernel-janitors

On 07/31/2014 09:22 AM, Dan Carpenter wrote:
> This shoudld be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
>
> Fixes: dc0a39386687 ('pinctrl: Add NVIDIA Tegra XUSB pad controller support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

This series looks fine to me.

Linus, since the XUSB driver got merged through the Tegra tree, should I 
send these fixes through arm-soc on top of the driver addition patches 
(hoping to get them in before -rc1), or will you take them through the 
pinctrl tree immediately after -rc1? The latter might be simpler.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch 1/2] pinctrl: tegra-xusb: fix an off by one test
  2014-07-31 15:22 [patch 1/2] pinctrl: tegra-xusb: fix an off by one test Dan Carpenter
  2014-07-31 15:34 ` Stephen Warren
@ 2014-07-31 15:36 ` Thierry Reding
  2014-08-11  6:55 ` Linus Walleij
  2 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2014-07-31 15:36 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Stephen Warren, Linus Walleij, Grant Likely, Rob Herring,
	linux-tegra, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 869 bytes --]

On Thu, Jul 31, 2014 at 06:22:17PM +0300, Dan Carpenter wrote:
> This shoudld be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
> 
> Fixes: dc0a39386687 ('pinctrl: Add NVIDIA Tegra XUSB pad controller support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/pinctrl/pinctrl-tegra-xusb.c b/drivers/pinctrl/pinctrl-tegra-xusb.c
> index a066204..419a047 100644
> --- a/drivers/pinctrl/pinctrl-tegra-xusb.c
> +++ b/drivers/pinctrl/pinctrl-tegra-xusb.c
> @@ -680,7 +680,7 @@ static struct phy *tegra_xusb_padctl_xlate(struct device *dev,
>  	if (args->args_count <= 0)
>  		return ERR_PTR(-EINVAL);
>  
> -	if (index > ARRAY_SIZE(padctl->phys))
> +	if (index >= ARRAY_SIZE(padctl->phys))
>  		return ERR_PTR(-EINVAL);
>  
>  	return padctl->phys[index];

Good catch!

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch 1/2] pinctrl: tegra-xusb: fix an off by one test
  2014-07-31 15:22 [patch 1/2] pinctrl: tegra-xusb: fix an off by one test Dan Carpenter
  2014-07-31 15:34 ` Stephen Warren
  2014-07-31 15:36 ` Thierry Reding
@ 2014-08-11  6:55 ` Linus Walleij
  2 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2014-08-11  6:55 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Stephen Warren, Thierry Reding, Grant Likely, Rob Herring,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

On Thu, Jul 31, 2014 at 5:22 PM, Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:

> This shoudld be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
>
> Fixes: dc0a39386687 ('pinctrl: Add NVIDIA Tegra XUSB pad controller support')
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

Patch applied with Stephen's and Thierry's ACKs.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch 1/2] pinctrl: tegra-xusb: fix an off by one test
  2014-07-31 15:34 ` Stephen Warren
@ 2014-08-11  6:56   ` Linus Walleij
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2014-08-11  6:56 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Dan Carpenter, Thierry Reding, Grant Likely, Rob Herring,
	linux-tegra@vger.kernel.org, kernel-janitors

On Thu, Jul 31, 2014 at 5:34 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 07/31/2014 09:22 AM, Dan Carpenter wrote:
>>
>> This shoudld be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
>>
>> Fixes: dc0a39386687 ('pinctrl: Add NVIDIA Tegra XUSB pad controller
>> support')
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
>
> This series looks fine to me.

I record this as an Acked-by.

> Linus, since the XUSB driver got merged through the Tegra tree, should I
> send these fixes through arm-soc on top of the driver addition patches
> (hoping to get them in before -rc1), or will you take them through the
> pinctrl tree immediately after -rc1? The latter might be simpler.

Yeah I'm carrying them.

Thanks!
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-11  6:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-31 15:22 [patch 1/2] pinctrl: tegra-xusb: fix an off by one test Dan Carpenter
2014-07-31 15:34 ` Stephen Warren
2014-08-11  6:56   ` Linus Walleij
2014-07-31 15:36 ` Thierry Reding
2014-08-11  6:55 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).