diff mbox

[v4,4/6] pinctrl: st: Use ARRAY_SIZE instead of raw value for number of delays

Message ID 1394614210-15698-5-git-send-email-maxime.coquelin@st.com
State Accepted
Commit 88430acf38da72256cff933aae71de51c3e03acc
Headers show

Commit Message

Maxime COQUELIN March 12, 2014, 8:50 a.m. UTC
This patch replaces the raw values with ARRAY_SIZE for assigning the
ninput_delays and noutput_delays fields of STiH416's st_pctl_data struct.

CC: Lee Jones <lee.jones@linaro.org>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>
---
 drivers/pinctrl/pinctrl-st.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Lee Jones March 12, 2014, 9:39 a.m. UTC | #1
> This patch replaces the raw values with ARRAY_SIZE for assigning the
> ninput_delays and noutput_delays fields of STiH416's st_pctl_data struct.
> 
> CC: Lee Jones <lee.jones@linaro.org>
> Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>
> ---
>  drivers/pinctrl/pinctrl-st.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Lee Jones <lee.jones@linaro.org>
Linus Walleij March 12, 2014, 2:19 p.m. UTC | #2
On Wed, Mar 12, 2014 at 9:50 AM, Maxime COQUELIN <maxime.coquelin@st.com> wrote:

> This patch replaces the raw values with ARRAY_SIZE for assigning the
> ninput_delays and noutput_delays fields of STiH416's st_pctl_data struct.
>
> CC: Lee Jones <lee.jones@linaro.org>
> Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>

Patch applied!

Yours,
Linus Walleij
--
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/
Joe Perches March 12, 2014, 2:25 p.m. UTC | #3
On Wed, 2014-03-12 at 09:50 +0100, Maxime COQUELIN wrote:
> This patch replaces the raw values with ARRAY_SIZE for assigning the
> ninput_delays and noutput_delays fields of STiH416's st_pctl_data struct.

trivial note:

> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
[]
> @@ -384,9 +384,9 @@ static unsigned int stih416_delays[] = {0, 300, 500, 750, 1000, 1250, 1500,
>  static const struct st_pctl_data  stih416_data = {
>  	.rt_style	= st_retime_style_dedicated,
>  	.input_delays	= stih416_delays,
> -	.ninput_delays	= 14,
> +	.ninput_delays	= ARRAY_SIZE(stih416_delays),
>  	.output_delays	= stih416_delays,
> -	.noutput_delays = 14,
> +	.noutput_delays = ARRAY_SIZE(stih416_delays),
>  	.alt = 0, .oe = 40, .pu = 50, .od = 60, .rt = 100,
>  };
>  

drivers/pinctrl/pinctrl-st.c-   unsigned int    *input_delays;
drivers/pinctrl/pinctrl-st.c-   unsigned int    *output_delays;

It may be better to change these to const unsigned int *
and change

static unsigned int stih416_delays[] = {

to static const


--
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/
Linus Walleij March 14, 2014, 9:20 a.m. UTC | #4
On Wed, Mar 12, 2014 at 3:25 PM, Joe Perches <joe@perches.com> wrote:
> On Wed, 2014-03-12 at 09:50 +0100, Maxime COQUELIN wrote:
>> This patch replaces the raw values with ARRAY_SIZE for assigning the
>> ninput_delays and noutput_delays fields of STiH416's st_pctl_data struct.
>
> trivial note:
>
>> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
> []
>> @@ -384,9 +384,9 @@ static unsigned int stih416_delays[] = {0, 300, 500, 750, 1000, 1250, 1500,
>>  static const struct st_pctl_data  stih416_data = {
>>       .rt_style       = st_retime_style_dedicated,
>>       .input_delays   = stih416_delays,
>> -     .ninput_delays  = 14,
>> +     .ninput_delays  = ARRAY_SIZE(stih416_delays),
>>       .output_delays  = stih416_delays,
>> -     .noutput_delays = 14,
>> +     .noutput_delays = ARRAY_SIZE(stih416_delays),
>>       .alt = 0, .oe = 40, .pu = 50, .od = 60, .rt = 100,
>>  };
>>
>
> drivers/pinctrl/pinctrl-st.c-   unsigned int    *input_delays;
> drivers/pinctrl/pinctrl-st.c-   unsigned int    *output_delays;
>
> It may be better to change these to const unsigned int *
> and change
>
> static unsigned int stih416_delays[] = {
>
> to static const

Good point. Patches accepted :-)

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Maxime COQUELIN March 14, 2014, 9:44 a.m. UTC | #5
On 03/14/2014 10:20 AM, Linus Walleij wrote:
> On Wed, Mar 12, 2014 at 3:25 PM, Joe Perches <joe@perches.com> wrote:
>> On Wed, 2014-03-12 at 09:50 +0100, Maxime COQUELIN wrote:
>>> This patch replaces the raw values with ARRAY_SIZE for assigning the
>>> ninput_delays and noutput_delays fields of STiH416's st_pctl_data struct.
>>
>> trivial note:
>>
>>> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
>> []
>>> @@ -384,9 +384,9 @@ static unsigned int stih416_delays[] = {0, 300, 500, 750, 1000, 1250, 1500,
>>>   static const struct st_pctl_data  stih416_data = {
>>>        .rt_style       = st_retime_style_dedicated,
>>>        .input_delays   = stih416_delays,
>>> -     .ninput_delays  = 14,
>>> +     .ninput_delays  = ARRAY_SIZE(stih416_delays),
>>>        .output_delays  = stih416_delays,
>>> -     .noutput_delays = 14,
>>> +     .noutput_delays = ARRAY_SIZE(stih416_delays),
>>>        .alt = 0, .oe = 40, .pu = 50, .od = 60, .rt = 100,
>>>   };
>>>
>>
>> drivers/pinctrl/pinctrl-st.c-   unsigned int    *input_delays;
>> drivers/pinctrl/pinctrl-st.c-   unsigned int    *output_delays;
>>
>> It may be better to change these to const unsigned int *
>> and change
>>
>> static unsigned int stih416_delays[] = {
>>
>> to static const
>
> Good point. Patches accepted :-)

Sorry Joe, I forgot to reply.

I added this to my todo list.
I will provide the change before end of next week.

Thanks,
Maxime

>
> Yours,
> Linus Walleij
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index 39cddaa..e4c4799 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -384,9 +384,9 @@  static unsigned int stih416_delays[] = {0, 300, 500, 750, 1000, 1250, 1500,
 static const struct st_pctl_data  stih416_data = {
 	.rt_style	= st_retime_style_dedicated,
 	.input_delays	= stih416_delays,
-	.ninput_delays	= 14,
+	.ninput_delays	= ARRAY_SIZE(stih416_delays),
 	.output_delays	= stih416_delays,
-	.noutput_delays = 14,
+	.noutput_delays = ARRAY_SIZE(stih416_delays),
 	.alt = 0, .oe = 40, .pu = 50, .od = 60, .rt = 100,
 };