* [PATCH] of: pass name argument for of_io_request_and_map as const char *
@ 2014-11-12 18:17 Chen-Yu Tsai
2014-11-13 9:04 ` Matthias Brugger
0 siblings, 1 reply; 3+ messages in thread
From: Chen-Yu Tsai @ 2014-11-12 18:17 UTC (permalink / raw)
To: Grant Likely, Rob Herring
Cc: Chen-Yu Tsai, devicetree, linux-kernel, linux-arm-kernel,
Mike Turquette, Maxime Ripard, Emilio Lopez, Matthias Brugger
The name argument for of_io_request_and_map is only passed to
request_mem_region, which is a macro of __request_region, which
takes a const name argument.
Make the name argument const, so when we pass const strings we
don't get the following warnings:
warning: passing argument 3 of 'of_io_request_and_map' discards
'const' qualifier from pointer target type [enabled by default]
In file included from drivers/clk/sunxi/clk-sunxi.c:20:0:
include/linux/of_address.h:108:15: note: expected 'char *' but
argument is of type 'const char *'
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
---
I ran into this while switching some of the sunxi clock code to use
of_io_request_and_map.
---
drivers/of/address.c | 2 +-
include/linux/of_address.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/of/address.c b/drivers/of/address.c
index afdb782..e02828f 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -871,7 +871,7 @@ EXPORT_SYMBOL(of_iomap);
* return PTR_ERR(base);
*/
void __iomem *of_io_request_and_map(struct device_node *np, int index,
- char *name)
+ const char *name)
{
struct resource res;
void __iomem *mem;
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index 8cb14eb..d88e81b 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -106,7 +106,7 @@ extern int of_address_to_resource(struct device_node *dev, int index,
struct resource *r);
void __iomem *of_iomap(struct device_node *node, int index);
void __iomem *of_io_request_and_map(struct device_node *device,
- int index, char *name);
+ int index, const char *name);
#else
#include <linux/io.h>
@@ -123,7 +123,7 @@ static inline void __iomem *of_iomap(struct device_node *device, int index)
}
static inline void __iomem *of_io_request_and_map(struct device_node *device,
- int index, char *name)
+ int index, const char *name)
{
return IOMEM_ERR_PTR(-EINVAL);
}
--
2.1.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] of: pass name argument for of_io_request_and_map as const char *
2014-11-12 18:17 [PATCH] of: pass name argument for of_io_request_and_map as const char * Chen-Yu Tsai
@ 2014-11-13 9:04 ` Matthias Brugger
2014-11-13 18:56 ` Chen-Yu Tsai
0 siblings, 1 reply; 3+ messages in thread
From: Matthias Brugger @ 2014-11-13 9:04 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Grant Likely, Rob Herring, devicetree, linux-kernel,
linux-arm-kernel, Mike Turquette, Maxime Ripard, Emilio Lopez
I already send a patch for that which got accepted by Grant [0].
Although right now, I'm not able to find it on his repository [1].
Cheers,
Matthias
[0] https://lkml.org/lkml/2014/11/4/588
[1] https://git.kernel.org/cgit/linux/kernel/git/glikely/linux.git/
2014-11-12 19:17 GMT+01:00 Chen-Yu Tsai <wens@csie.org>:
> The name argument for of_io_request_and_map is only passed to
> request_mem_region, which is a macro of __request_region, which
> takes a const name argument.
>
> Make the name argument const, so when we pass const strings we
> don't get the following warnings:
>
> warning: passing argument 3 of 'of_io_request_and_map' discards
> 'const' qualifier from pointer target type [enabled by default]
>
> In file included from drivers/clk/sunxi/clk-sunxi.c:20:0:
> include/linux/of_address.h:108:15: note: expected 'char *' but
> argument is of type 'const char *'
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> ---
>
> I ran into this while switching some of the sunxi clock code to use
> of_io_request_and_map.
>
> ---
> drivers/of/address.c | 2 +-
> include/linux/of_address.h | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/of/address.c b/drivers/of/address.c
> index afdb782..e02828f 100644
> --- a/drivers/of/address.c
> +++ b/drivers/of/address.c
> @@ -871,7 +871,7 @@ EXPORT_SYMBOL(of_iomap);
> * return PTR_ERR(base);
> */
> void __iomem *of_io_request_and_map(struct device_node *np, int index,
> - char *name)
> + const char *name)
> {
> struct resource res;
> void __iomem *mem;
> diff --git a/include/linux/of_address.h b/include/linux/of_address.h
> index 8cb14eb..d88e81b 100644
> --- a/include/linux/of_address.h
> +++ b/include/linux/of_address.h
> @@ -106,7 +106,7 @@ extern int of_address_to_resource(struct device_node *dev, int index,
> struct resource *r);
> void __iomem *of_iomap(struct device_node *node, int index);
> void __iomem *of_io_request_and_map(struct device_node *device,
> - int index, char *name);
> + int index, const char *name);
> #else
>
> #include <linux/io.h>
> @@ -123,7 +123,7 @@ static inline void __iomem *of_iomap(struct device_node *device, int index)
> }
>
> static inline void __iomem *of_io_request_and_map(struct device_node *device,
> - int index, char *name)
> + int index, const char *name)
> {
> return IOMEM_ERR_PTR(-EINVAL);
> }
> --
> 2.1.3
>
--
motzblog.wordpress.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] of: pass name argument for of_io_request_and_map as const char *
2014-11-13 9:04 ` Matthias Brugger
@ 2014-11-13 18:56 ` Chen-Yu Tsai
0 siblings, 0 replies; 3+ messages in thread
From: Chen-Yu Tsai @ 2014-11-13 18:56 UTC (permalink / raw)
To: Matthias Brugger
Cc: Grant Likely, Rob Herring, devicetree, linux-kernel,
linux-arm-kernel, Mike Turquette, Maxime Ripard, Emilio Lopez
On Thu, Nov 13, 2014 at 5:04 PM, Matthias Brugger
<matthias.bgg@gmail.com> wrote:
> I already send a patch for that which got accepted by Grant [0].
> Although right now, I'm not able to find it on his repository [1].
Oh great! Please ignore this one then.
ChenYu
> Cheers,
> Matthias
>
> [0] https://lkml.org/lkml/2014/11/4/588
> [1] https://git.kernel.org/cgit/linux/kernel/git/glikely/linux.git/
>
> 2014-11-12 19:17 GMT+01:00 Chen-Yu Tsai <wens@csie.org>:
>> The name argument for of_io_request_and_map is only passed to
>> request_mem_region, which is a macro of __request_region, which
>> takes a const name argument.
>>
>> Make the name argument const, so when we pass const strings we
>> don't get the following warnings:
>>
>> warning: passing argument 3 of 'of_io_request_and_map' discards
>> 'const' qualifier from pointer target type [enabled by default]
>>
>> In file included from drivers/clk/sunxi/clk-sunxi.c:20:0:
>> include/linux/of_address.h:108:15: note: expected 'char *' but
>> argument is of type 'const char *'
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> Cc: Matthias Brugger <matthias.bgg@gmail.com>
>> ---
>>
>> I ran into this while switching some of the sunxi clock code to use
>> of_io_request_and_map.
>>
>> ---
>> drivers/of/address.c | 2 +-
>> include/linux/of_address.h | 4 ++--
>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/of/address.c b/drivers/of/address.c
>> index afdb782..e02828f 100644
>> --- a/drivers/of/address.c
>> +++ b/drivers/of/address.c
>> @@ -871,7 +871,7 @@ EXPORT_SYMBOL(of_iomap);
>> * return PTR_ERR(base);
>> */
>> void __iomem *of_io_request_and_map(struct device_node *np, int index,
>> - char *name)
>> + const char *name)
>> {
>> struct resource res;
>> void __iomem *mem;
>> diff --git a/include/linux/of_address.h b/include/linux/of_address.h
>> index 8cb14eb..d88e81b 100644
>> --- a/include/linux/of_address.h
>> +++ b/include/linux/of_address.h
>> @@ -106,7 +106,7 @@ extern int of_address_to_resource(struct device_node *dev, int index,
>> struct resource *r);
>> void __iomem *of_iomap(struct device_node *node, int index);
>> void __iomem *of_io_request_and_map(struct device_node *device,
>> - int index, char *name);
>> + int index, const char *name);
>> #else
>>
>> #include <linux/io.h>
>> @@ -123,7 +123,7 @@ static inline void __iomem *of_iomap(struct device_node *device, int index)
>> }
>>
>> static inline void __iomem *of_io_request_and_map(struct device_node *device,
>> - int index, char *name)
>> + int index, const char *name)
>> {
>> return IOMEM_ERR_PTR(-EINVAL);
>> }
>> --
>> 2.1.3
>>
>
>
>
> --
> motzblog.wordpress.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-13 18:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-12 18:17 [PATCH] of: pass name argument for of_io_request_and_map as const char * Chen-Yu Tsai
2014-11-13 9:04 ` Matthias Brugger
2014-11-13 18:56 ` Chen-Yu Tsai
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).