linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: fix constconst in devres
@ 2015-03-11 11:24 Linus Walleij
  2015-03-11 12:22 ` Rojhalat Ibrahim
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2015-03-11 11:24 UTC (permalink / raw)
  To: linux-gpio; +Cc: Alexandre Courbot, Linus Walleij, Olliver Schinagl

Commit 1feb57a245a4910b03202a814ffc51a900bd4aca
"gpio: add parameter to allow the use named gpios"
includes a double-conted array. Fix this.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/devres.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
index ec24da2418b3..0bd060bf7151 100644
--- a/drivers/gpio/devres.c
+++ b/drivers/gpio/devres.c
@@ -135,7 +135,7 @@ struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
 					    const char *con_id,
 					    struct fwnode_handle *child)
 {
-	static const char const *suffixes[] = { "gpios", "gpio" };
+	static const char *suffixes[] = { "gpios", "gpio" };
 	char prop_name[32]; /* 32 is max size of property name */
 	struct gpio_desc **dr;
 	struct gpio_desc *desc;
-- 
1.9.3


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

* Re: [PATCH] gpio: fix constconst in devres
  2015-03-11 11:24 [PATCH] gpio: fix constconst in devres Linus Walleij
@ 2015-03-11 12:22 ` Rojhalat Ibrahim
  2015-03-11 12:48   ` Olliver Schinagl
  0 siblings, 1 reply; 5+ messages in thread
From: Rojhalat Ibrahim @ 2015-03-11 12:22 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, Alexandre Courbot, Olliver Schinagl

On Wednesday 11 March 2015 12:24:38 Linus Walleij wrote:
> Commit 1feb57a245a4910b03202a814ffc51a900bd4aca
> "gpio: add parameter to allow the use named gpios"
> includes a double-conted array. Fix this.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Cc: Olliver Schinagl <oliver@schinagl.nl>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/gpio/devres.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
> index ec24da2418b3..0bd060bf7151 100644
> --- a/drivers/gpio/devres.c
> +++ b/drivers/gpio/devres.c
> @@ -135,7 +135,7 @@ struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
>  					    const char *con_id,
>  					    struct fwnode_handle *child)
>  {
> -	static const char const *suffixes[] = { "gpios", "gpio" };
> +	static const char *suffixes[] = { "gpios", "gpio" };
>  	char prop_name[32]; /* 32 is max size of property name */
>  	struct gpio_desc **dr;
>  	struct gpio_desc *desc;
> 

Shouldn't it be const char * const suffixes[], as in a const pointer to const data?

Wouldn't it be better to add an #include "gpiolib.h" to devres.c and use
the gpio_suffixes array defined in gliolib.h?



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

* Re: [PATCH] gpio: fix constconst in devres
  2015-03-11 12:22 ` Rojhalat Ibrahim
@ 2015-03-11 12:48   ` Olliver Schinagl
  2015-03-11 14:23     ` Rojhalat Ibrahim
  0 siblings, 1 reply; 5+ messages in thread
From: Olliver Schinagl @ 2015-03-11 12:48 UTC (permalink / raw)
  To: Rojhalat Ibrahim, Linus Walleij; +Cc: linux-gpio, Alexandre Courbot

Hey all,

On 11-03-15 13:22, Rojhalat Ibrahim wrote:
> On Wednesday 11 March 2015 12:24:38 Linus Walleij wrote:
>> Commit 1feb57a245a4910b03202a814ffc51a900bd4aca
>> "gpio: add parameter to allow the use named gpios"
>> includes a double-conted array. Fix this.
>>
>> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>> Cc: Olliver Schinagl <oliver@schinagl.nl>
>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>> ---
>>   drivers/gpio/devres.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
>> index ec24da2418b3..0bd060bf7151 100644
>> --- a/drivers/gpio/devres.c
>> +++ b/drivers/gpio/devres.c
>> @@ -135,7 +135,7 @@ struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
>>   					    const char *con_id,
>>   					    struct fwnode_handle *child)
>>   {
>> -	static const char const *suffixes[] = { "gpios", "gpio" };
>> +	static const char *suffixes[] = { "gpios", "gpio" };
>>   	char prop_name[32]; /* 32 is max size of property name */
>>   	struct gpio_desc **dr;
>>   	struct gpio_desc *desc;
>>
> Shouldn't it be const char * const suffixes[], as in a const pointer to const data?
I sent a patch to fix this weeks ago I belive.
> Wouldn't it be better to add an #include "gpiolib.h" to devres.c and use
> the gpio_suffixes array defined in gliolib.h?
I did not know we had that, that sounds logical. I can cook up a patch 
for that to work on both invocations!

olliver
>
>


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

* Re: [PATCH] gpio: fix constconst in devres
  2015-03-11 12:48   ` Olliver Schinagl
@ 2015-03-11 14:23     ` Rojhalat Ibrahim
  2015-03-12  9:00       ` Olliver Schinagl
  0 siblings, 1 reply; 5+ messages in thread
From: Rojhalat Ibrahim @ 2015-03-11 14:23 UTC (permalink / raw)
  To: Olliver Schinagl; +Cc: Linus Walleij, linux-gpio, Alexandre Courbot

On Wednesday 11 March 2015 13:48:16 Olliver Schinagl wrote:
> Hey all,
> 
> On 11-03-15 13:22, Rojhalat Ibrahim wrote:
> > On Wednesday 11 March 2015 12:24:38 Linus Walleij wrote:
> >> Commit 1feb57a245a4910b03202a814ffc51a900bd4aca
> >> "gpio: add parameter to allow the use named gpios"
> >> includes a double-conted array. Fix this.
> >>
> >> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> >> Cc: Olliver Schinagl <oliver@schinagl.nl>
> >> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> >> ---
> >>   drivers/gpio/devres.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
> >> index ec24da2418b3..0bd060bf7151 100644
> >> --- a/drivers/gpio/devres.c
> >> +++ b/drivers/gpio/devres.c
> >> @@ -135,7 +135,7 @@ struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
> >>   					    const char *con_id,
> >>   					    struct fwnode_handle *child)
> >>   {
> >> -	static const char const *suffixes[] = { "gpios", "gpio" };
> >> +	static const char *suffixes[] = { "gpios", "gpio" };
> >>   	char prop_name[32]; /* 32 is max size of property name */
> >>   	struct gpio_desc **dr;
> >>   	struct gpio_desc *desc;
> >>
> > Shouldn't it be const char * const suffixes[], as in a const pointer to const data?
> I sent a patch to fix this weeks ago I belive.
> > Wouldn't it be better to add an #include "gpiolib.h" to devres.c and use
> > the gpio_suffixes array defined in gliolib.h?
> I did not know we had that, that sounds logical. I can cook up a patch 
> for that to work on both invocations!
> 

The gpio_suffixes array in gpiolib.h was added only very recently (after your
patch that added the declaration here). So you couldn't have known.



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

* Re: [PATCH] gpio: fix constconst in devres
  2015-03-11 14:23     ` Rojhalat Ibrahim
@ 2015-03-12  9:00       ` Olliver Schinagl
  0 siblings, 0 replies; 5+ messages in thread
From: Olliver Schinagl @ 2015-03-12  9:00 UTC (permalink / raw)
  To: Rojhalat Ibrahim; +Cc: Linus Walleij, linux-gpio, Alexandre Courbot

Hey all,

On 11-03-15 15:23, Rojhalat Ibrahim wrote:
> On Wednesday 11 March 2015 13:48:16 Olliver Schinagl wrote:
>> Hey all,
>>
>> On 11-03-15 13:22, Rojhalat Ibrahim wrote:
>>> On Wednesday 11 March 2015 12:24:38 Linus Walleij wrote:
>>>> Commit 1feb57a245a4910b03202a814ffc51a900bd4aca
>>>> "gpio: add parameter to allow the use named gpios"
>>>> includes a double-conted array. Fix this.
>>>>
>>>> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>>>> Cc: Olliver Schinagl <oliver@schinagl.nl>
>>>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>>>> ---
>>>>    drivers/gpio/devres.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
>>>> index ec24da2418b3..0bd060bf7151 100644
>>>> --- a/drivers/gpio/devres.c
>>>> +++ b/drivers/gpio/devres.c
>>>> @@ -135,7 +135,7 @@ struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
>>>>    					    const char *con_id,
>>>>    					    struct fwnode_handle *child)
>>>>    {
>>>> -	static const char const *suffixes[] = { "gpios", "gpio" };
>>>> +	static const char *suffixes[] = { "gpios", "gpio" };
>>>>    	char prop_name[32]; /* 32 is max size of property name */
>>>>    	struct gpio_desc **dr;
>>>>    	struct gpio_desc *desc;
>>>>
>>> Shouldn't it be const char * const suffixes[], as in a const pointer to const data?
>> I sent a patch to fix this weeks ago I belive.
>>> Wouldn't it be better to add an #include "gpiolib.h" to devres.c and use
>>> the gpio_suffixes array defined in gliolib.h?
>> I did not know we had that, that sounds logical. I can cook up a patch
>> for that to work on both invocations!
>>
> The gpio_suffixes array in gpiolib.h was added only very recently (after your
> patch that added the declaration here). So you couldn't have known.
Ah, fair enough. I'll rebase and make a patch then for it :)
>


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

end of thread, other threads:[~2015-03-12  9:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-11 11:24 [PATCH] gpio: fix constconst in devres Linus Walleij
2015-03-11 12:22 ` Rojhalat Ibrahim
2015-03-11 12:48   ` Olliver Schinagl
2015-03-11 14:23     ` Rojhalat Ibrahim
2015-03-12  9:00       ` Olliver Schinagl

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).