All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb()
@ 2017-01-19  9:13 Cédric Le Goater
  2017-01-19 17:21 ` Marek Vasut
  2017-02-08 23:37 ` Brian Norris
  0 siblings, 2 replies; 10+ messages in thread
From: Cédric Le Goater @ 2017-01-19  9:13 UTC (permalink / raw)
  To: linux-mtd
  Cc: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Cédric Le Goater

The first argument of ioread32_rep() and ioread8_rep is not
const. Change aspeed_smc_read_from_ahb() prototype to fix compile
warning :

   drivers/mtd/spi-nor/aspeed-smc.c: In function 'aspeed_smc_read_from_ahb':
   drivers/mtd/spi-nor/aspeed-smc.c:212:16: warning: passing argument 1 of 'ioread32_rep' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      ioread32_rep(src, buf, len >> 2);

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 drivers/mtd/spi-nor/aspeed-smc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mtd/spi-nor/aspeed-smc.c b/drivers/mtd/spi-nor/aspeed-smc.c
index 6bb4c7d1788c..7c86099450be 100644
--- a/drivers/mtd/spi-nor/aspeed-smc.c
+++ b/drivers/mtd/spi-nor/aspeed-smc.c
@@ -222,8 +222,7 @@ struct aspeed_smc_controller {
  * the memory buffer pointer and count via explicit code. The final updates
  * to len are optimistically suppressed.
  */
-static int aspeed_smc_read_from_ahb(void *buf, const void __iomem *src,
-				    size_t len)
+static int aspeed_smc_read_from_ahb(void *buf, void __iomem *src, size_t len)
 {
 	size_t offset = 0;
 
-- 
2.7.4

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

* Re: [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb()
  2017-01-19  9:13 [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb() Cédric Le Goater
@ 2017-01-19 17:21 ` Marek Vasut
  2017-01-20 13:11   ` Cyrille Pitchen
  2017-02-08 23:37 ` Brian Norris
  1 sibling, 1 reply; 10+ messages in thread
From: Marek Vasut @ 2017-01-19 17:21 UTC (permalink / raw)
  To: Cédric Le Goater, linux-mtd
  Cc: David Woodhouse, Brian Norris, Boris Brezillon,
	Richard Weinberger, Cyrille Pitchen

On 01/19/2017 10:13 AM, Cédric Le Goater wrote:
> The first argument of ioread32_rep() and ioread8_rep is not
> const. Change aspeed_smc_read_from_ahb() prototype to fix compile
> warning :
> 
>    drivers/mtd/spi-nor/aspeed-smc.c: In function 'aspeed_smc_read_from_ahb':
>    drivers/mtd/spi-nor/aspeed-smc.c:212:16: warning: passing argument 1 of 'ioread32_rep' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>       ioread32_rep(src, buf, len >> 2);
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

In this case it's IMO OK:

Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

> ---
>  drivers/mtd/spi-nor/aspeed-smc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/aspeed-smc.c b/drivers/mtd/spi-nor/aspeed-smc.c
> index 6bb4c7d1788c..7c86099450be 100644
> --- a/drivers/mtd/spi-nor/aspeed-smc.c
> +++ b/drivers/mtd/spi-nor/aspeed-smc.c
> @@ -222,8 +222,7 @@ struct aspeed_smc_controller {
>   * the memory buffer pointer and count via explicit code. The final updates
>   * to len are optimistically suppressed.
>   */
> -static int aspeed_smc_read_from_ahb(void *buf, const void __iomem *src,
> -				    size_t len)
> +static int aspeed_smc_read_from_ahb(void *buf, void __iomem *src, size_t len)
>  {
>  	size_t offset = 0;
>  
> 


-- 
Best regards,
Marek Vasut

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

* Re: [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb()
  2017-01-19 17:21 ` Marek Vasut
@ 2017-01-20 13:11   ` Cyrille Pitchen
  0 siblings, 0 replies; 10+ messages in thread
From: Cyrille Pitchen @ 2017-01-20 13:11 UTC (permalink / raw)
  To: Marek Vasut, Cédric Le Goater, linux-mtd
  Cc: David Woodhouse, Brian Norris, Boris Brezillon, Richard Weinberger

Le 19/01/2017 à 18:21, Marek Vasut a écrit :
> On 01/19/2017 10:13 AM, Cédric Le Goater wrote:
>> The first argument of ioread32_rep() and ioread8_rep is not
>> const. Change aspeed_smc_read_from_ahb() prototype to fix compile
>> warning :
>>
>>    drivers/mtd/spi-nor/aspeed-smc.c: In function 'aspeed_smc_read_from_ahb':
>>    drivers/mtd/spi-nor/aspeed-smc.c:212:16: warning: passing argument 1 of 'ioread32_rep' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>>       ioread32_rep(src, buf, len >> 2);
>>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> 
> In this case it's IMO OK:
> 
> Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
>
Applied to git://github.com/spi-nor/linux.git

Thanks!

>> ---
>>  drivers/mtd/spi-nor/aspeed-smc.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/mtd/spi-nor/aspeed-smc.c b/drivers/mtd/spi-nor/aspeed-smc.c
>> index 6bb4c7d1788c..7c86099450be 100644
>> --- a/drivers/mtd/spi-nor/aspeed-smc.c
>> +++ b/drivers/mtd/spi-nor/aspeed-smc.c
>> @@ -222,8 +222,7 @@ struct aspeed_smc_controller {
>>   * the memory buffer pointer and count via explicit code. The final updates
>>   * to len are optimistically suppressed.
>>   */
>> -static int aspeed_smc_read_from_ahb(void *buf, const void __iomem *src,
>> -				    size_t len)
>> +static int aspeed_smc_read_from_ahb(void *buf, void __iomem *src, size_t len)
>>  {
>>  	size_t offset = 0;
>>  
>>
> 
> 

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

* Re: [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb()
  2017-01-19  9:13 [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb() Cédric Le Goater
  2017-01-19 17:21 ` Marek Vasut
@ 2017-02-08 23:37 ` Brian Norris
  2017-02-09  9:05   ` Marek Vasut
  1 sibling, 1 reply; 10+ messages in thread
From: Brian Norris @ 2017-02-08 23:37 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: linux-mtd, David Woodhouse, Boris Brezillon, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen

On Thu, Jan 19, 2017 at 10:13:18AM +0100, Cédric Le Goater wrote:
> The first argument of ioread32_rep() and ioread8_rep is not
> const. Change aspeed_smc_read_from_ahb() prototype to fix compile
> warning :
> 
>    drivers/mtd/spi-nor/aspeed-smc.c: In function 'aspeed_smc_read_from_ahb':
>    drivers/mtd/spi-nor/aspeed-smc.c:212:16: warning: passing argument 1 of 'ioread32_rep' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>       ioread32_rep(src, buf, len >> 2);

But why isn't that param constant? Seems like that's a bug in the
ioread* APIs. Some of their implementations are const, but some are not.

I see for instance that the implementation in lib/iomap.c is not const,
where there's zero reason it shouldn't be (if we also fix, e.g., its
mmio_insl()).

Brian

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

* Re: [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb()
  2017-02-08 23:37 ` Brian Norris
@ 2017-02-09  9:05   ` Marek Vasut
  2017-02-09  9:59     ` Cédric Le Goater
  2017-02-10 18:11     ` Brian Norris
  0 siblings, 2 replies; 10+ messages in thread
From: Marek Vasut @ 2017-02-09  9:05 UTC (permalink / raw)
  To: Brian Norris, Cédric Le Goater
  Cc: linux-mtd, David Woodhouse, Boris Brezillon, Richard Weinberger,
	Cyrille Pitchen

On 02/09/2017 12:37 AM, Brian Norris wrote:
> On Thu, Jan 19, 2017 at 10:13:18AM +0100, Cédric Le Goater wrote:
>> The first argument of ioread32_rep() and ioread8_rep is not
>> const. Change aspeed_smc_read_from_ahb() prototype to fix compile
>> warning :
>>
>>    drivers/mtd/spi-nor/aspeed-smc.c: In function 'aspeed_smc_read_from_ahb':
>>    drivers/mtd/spi-nor/aspeed-smc.c:212:16: warning: passing argument 1 of 'ioread32_rep' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>>       ioread32_rep(src, buf, len >> 2);
> 
> But why isn't that param constant? Seems like that's a bug in the
> ioread* APIs. Some of their implementations are const, but some are not.
> 
> I see for instance that the implementation in lib/iomap.c is not const,
> where there's zero reason it shouldn't be (if we also fix, e.g., its
> mmio_insl()).

Maybe it's worth fixing the ioread*_rep then ? Then again, that seems to
be way far off the scope of this patch.

-- 
Best regards,
Marek Vasut

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

* Re: [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb()
  2017-02-09  9:05   ` Marek Vasut
@ 2017-02-09  9:59     ` Cédric Le Goater
  2017-02-09 15:04       ` Marek Vasut
  2017-02-10 18:11     ` Brian Norris
  1 sibling, 1 reply; 10+ messages in thread
From: Cédric Le Goater @ 2017-02-09  9:59 UTC (permalink / raw)
  To: Marek Vasut, Brian Norris
  Cc: linux-mtd, David Woodhouse, Boris Brezillon, Richard Weinberger,
	Cyrille Pitchen

On 02/09/2017 10:05 AM, Marek Vasut wrote:
> On 02/09/2017 12:37 AM, Brian Norris wrote:
>> On Thu, Jan 19, 2017 at 10:13:18AM +0100, Cédric Le Goater wrote:
>>> The first argument of ioread32_rep() and ioread8_rep is not
>>> const. Change aspeed_smc_read_from_ahb() prototype to fix compile
>>> warning :
>>>
>>>    drivers/mtd/spi-nor/aspeed-smc.c: In function 'aspeed_smc_read_from_ahb':
>>>    drivers/mtd/spi-nor/aspeed-smc.c:212:16: warning: passing argument 1 of 'ioread32_rep' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>>>       ioread32_rep(src, buf, len >> 2);
>>
>> But why isn't that param constant? Seems like that's a bug in the
>> ioread* APIs. Some of their implementations are const, but some are not.
>>
>> I see for instance that the implementation in lib/iomap.c is not const,
>> where there's zero reason it shouldn't be (if we also fix, e.g., its
>> mmio_insl()).
> 
> Maybe it's worth fixing the ioread*_rep then ? Then again, that seems to
> be way far off the scope of this patch.

Looking closer at where this comes from, the compile warning was 
reported on x86 which pulls a different file for the definitions 
of the ioread routines.

On x86, arch/x86/include/asm/io.h includes <asm-generic/iomap.h>
which contains prototypes of the ioread routines without 'const'.

On ARM, arch/arm/include/asm/io.h includes <asm-generic/io.h>
which contains the 'const' definitions.


So may be, we should just drop that patch and fix iomap.h instead,
but quite a few arches use it :

arch/sh/include/asm/io.h:#include <asm-generic/iomap.h>
arch/mips/include/asm/io.h:#include <asm-generic/iomap.h>
arch/ia64/include/asm/io.h:#include <asm-generic/iomap.h>
arch/cris/include/asm/io.h:#include <asm-generic/iomap.h>
arch/x86/include/asm/io.h:#include <asm-generic/iomap.h>
arch/alpha/include/asm/io.h:#include <asm-generic/iomap.h>
arch/powerpc/include/asm/io.h:#include <asm-generic/iomap.h>
arch/m68k/include/asm/io_mm.h:#include <asm-generic/iomap.h>
arch/m68k/include/asm/io_no.h:#include <asm-generic/iomap.h>
arch/parisc/include/asm/io.h:#include <asm-generic/iomap.h>
include/asm-generic/io.h:#include <asm-generic/iomap.h>

Thanks,

C.

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

* Re: [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb()
  2017-02-09  9:59     ` Cédric Le Goater
@ 2017-02-09 15:04       ` Marek Vasut
  2017-02-10  5:50         ` Cédric Le Goater
  0 siblings, 1 reply; 10+ messages in thread
From: Marek Vasut @ 2017-02-09 15:04 UTC (permalink / raw)
  To: Cédric Le Goater, Brian Norris
  Cc: linux-mtd, David Woodhouse, Boris Brezillon, Richard Weinberger,
	Cyrille Pitchen

On 02/09/2017 10:59 AM, Cédric Le Goater wrote:
> On 02/09/2017 10:05 AM, Marek Vasut wrote:
>> On 02/09/2017 12:37 AM, Brian Norris wrote:
>>> On Thu, Jan 19, 2017 at 10:13:18AM +0100, Cédric Le Goater wrote:
>>>> The first argument of ioread32_rep() and ioread8_rep is not
>>>> const. Change aspeed_smc_read_from_ahb() prototype to fix compile
>>>> warning :
>>>>
>>>>    drivers/mtd/spi-nor/aspeed-smc.c: In function 'aspeed_smc_read_from_ahb':
>>>>    drivers/mtd/spi-nor/aspeed-smc.c:212:16: warning: passing argument 1 of 'ioread32_rep' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>>>>       ioread32_rep(src, buf, len >> 2);
>>>
>>> But why isn't that param constant? Seems like that's a bug in the
>>> ioread* APIs. Some of their implementations are const, but some are not.
>>>
>>> I see for instance that the implementation in lib/iomap.c is not const,
>>> where there's zero reason it shouldn't be (if we also fix, e.g., its
>>> mmio_insl()).
>>
>> Maybe it's worth fixing the ioread*_rep then ? Then again, that seems to
>> be way far off the scope of this patch.
> 
> Looking closer at where this comes from, the compile warning was 
> reported on x86 which pulls a different file for the definitions 
> of the ioread routines.

Well yes, intel is a special snowflake in the io accessor area.

> On x86, arch/x86/include/asm/io.h includes <asm-generic/iomap.h>
> which contains prototypes of the ioread routines without 'const'.
> 
> On ARM, arch/arm/include/asm/io.h includes <asm-generic/io.h>
> which contains the 'const' definitions.

Can you check if any of those arches needs it without const ?

> So may be, we should just drop that patch and fix iomap.h instead,
> but quite a few arches use it :
> 
> arch/sh/include/asm/io.h:#include <asm-generic/iomap.h>
> arch/mips/include/asm/io.h:#include <asm-generic/iomap.h>
> arch/ia64/include/asm/io.h:#include <asm-generic/iomap.h>
> arch/cris/include/asm/io.h:#include <asm-generic/iomap.h>
> arch/x86/include/asm/io.h:#include <asm-generic/iomap.h>
> arch/alpha/include/asm/io.h:#include <asm-generic/iomap.h>
> arch/powerpc/include/asm/io.h:#include <asm-generic/iomap.h>
> arch/m68k/include/asm/io_mm.h:#include <asm-generic/iomap.h>
> arch/m68k/include/asm/io_no.h:#include <asm-generic/iomap.h>
> arch/parisc/include/asm/io.h:#include <asm-generic/iomap.h>
> include/asm-generic/io.h:#include <asm-generic/iomap.h>
> 
> Thanks,
> 
> C.
> 


-- 
Best regards,
Marek Vasut

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

* Re: [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb()
  2017-02-09 15:04       ` Marek Vasut
@ 2017-02-10  5:50         ` Cédric Le Goater
  2017-02-10 15:09           ` Marek Vasut
  0 siblings, 1 reply; 10+ messages in thread
From: Cédric Le Goater @ 2017-02-10  5:50 UTC (permalink / raw)
  To: Marek Vasut, Brian Norris
  Cc: linux-mtd, David Woodhouse, Boris Brezillon, Richard Weinberger,
	Cyrille Pitchen

On 02/09/2017 04:04 PM, Marek Vasut wrote:
> On 02/09/2017 10:59 AM, Cédric Le Goater wrote:
>> On 02/09/2017 10:05 AM, Marek Vasut wrote:
>>> On 02/09/2017 12:37 AM, Brian Norris wrote:
>>>> On Thu, Jan 19, 2017 at 10:13:18AM +0100, Cédric Le Goater wrote:
>>>>> The first argument of ioread32_rep() and ioread8_rep is not
>>>>> const. Change aspeed_smc_read_from_ahb() prototype to fix compile
>>>>> warning :
>>>>>
>>>>>    drivers/mtd/spi-nor/aspeed-smc.c: In function 'aspeed_smc_read_from_ahb':
>>>>>    drivers/mtd/spi-nor/aspeed-smc.c:212:16: warning: passing argument 1 of 'ioread32_rep' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>>>>>       ioread32_rep(src, buf, len >> 2);
>>>>
>>>> But why isn't that param constant? Seems like that's a bug in the
>>>> ioread* APIs. Some of their implementations are const, but some are not.
>>>>
>>>> I see for instance that the implementation in lib/iomap.c is not const,
>>>> where there's zero reason it shouldn't be (if we also fix, e.g., its
>>>> mmio_insl()).
>>>
>>> Maybe it's worth fixing the ioread*_rep then ? Then again, that seems to
>>> be way far off the scope of this patch.
>>
>> Looking closer at where this comes from, the compile warning was 
>> reported on x86 which pulls a different file for the definitions 
>> of the ioread routines.
> 
> Well yes, intel is a special snowflake in the io accessor area.
> 
>> On x86, arch/x86/include/asm/io.h includes <asm-generic/iomap.h>
>> which contains prototypes of the ioread routines without 'const'.
>>
>> On ARM, arch/arm/include/asm/io.h includes <asm-generic/io.h>
>> which contains the 'const' definitions.
> 
> Can you check if any of those arches needs it without const ?

ok. I have checked over ppc, all defconfigs compile fine. 
I will send a patch to linuxppc to see how we can merged it 
in powerpc-next. The other arches would then be checked 
by the Intel 0-day bot.

C. 


> 
>> So may be, we should just drop that patch and fix iomap.h instead,
>> but quite a few arches use it :
>>
>> arch/sh/include/asm/io.h:#include <asm-generic/iomap.h>
>> arch/mips/include/asm/io.h:#include <asm-generic/iomap.h>
>> arch/ia64/include/asm/io.h:#include <asm-generic/iomap.h>
>> arch/cris/include/asm/io.h:#include <asm-generic/iomap.h>
>> arch/x86/include/asm/io.h:#include <asm-generic/iomap.h>
>> arch/alpha/include/asm/io.h:#include <asm-generic/iomap.h>
>> arch/powerpc/include/asm/io.h:#include <asm-generic/iomap.h>
>> arch/m68k/include/asm/io_mm.h:#include <asm-generic/iomap.h>
>> arch/m68k/include/asm/io_no.h:#include <asm-generic/iomap.h>
>> arch/parisc/include/asm/io.h:#include <asm-generic/iomap.h>
>> include/asm-generic/io.h:#include <asm-generic/iomap.h>
>>
>> Thanks,
>>
>> C.
>>
> 
> 

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

* Re: [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb()
  2017-02-10  5:50         ` Cédric Le Goater
@ 2017-02-10 15:09           ` Marek Vasut
  0 siblings, 0 replies; 10+ messages in thread
From: Marek Vasut @ 2017-02-10 15:09 UTC (permalink / raw)
  To: Cédric Le Goater, Brian Norris
  Cc: linux-mtd, David Woodhouse, Boris Brezillon, Richard Weinberger,
	Cyrille Pitchen

On 02/10/2017 06:50 AM, Cédric Le Goater wrote:
> On 02/09/2017 04:04 PM, Marek Vasut wrote:
>> On 02/09/2017 10:59 AM, Cédric Le Goater wrote:
>>> On 02/09/2017 10:05 AM, Marek Vasut wrote:
>>>> On 02/09/2017 12:37 AM, Brian Norris wrote:
>>>>> On Thu, Jan 19, 2017 at 10:13:18AM +0100, Cédric Le Goater wrote:
>>>>>> The first argument of ioread32_rep() and ioread8_rep is not
>>>>>> const. Change aspeed_smc_read_from_ahb() prototype to fix compile
>>>>>> warning :
>>>>>>
>>>>>>    drivers/mtd/spi-nor/aspeed-smc.c: In function 'aspeed_smc_read_from_ahb':
>>>>>>    drivers/mtd/spi-nor/aspeed-smc.c:212:16: warning: passing argument 1 of 'ioread32_rep' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>>>>>>       ioread32_rep(src, buf, len >> 2);
>>>>>
>>>>> But why isn't that param constant? Seems like that's a bug in the
>>>>> ioread* APIs. Some of their implementations are const, but some are not.
>>>>>
>>>>> I see for instance that the implementation in lib/iomap.c is not const,
>>>>> where there's zero reason it shouldn't be (if we also fix, e.g., its
>>>>> mmio_insl()).
>>>>
>>>> Maybe it's worth fixing the ioread*_rep then ? Then again, that seems to
>>>> be way far off the scope of this patch.
>>>
>>> Looking closer at where this comes from, the compile warning was 
>>> reported on x86 which pulls a different file for the definitions 
>>> of the ioread routines.
>>
>> Well yes, intel is a special snowflake in the io accessor area.
>>
>>> On x86, arch/x86/include/asm/io.h includes <asm-generic/iomap.h>
>>> which contains prototypes of the ioread routines without 'const'.
>>>
>>> On ARM, arch/arm/include/asm/io.h includes <asm-generic/io.h>
>>> which contains the 'const' definitions.
>>
>> Can you check if any of those arches needs it without const ?
> 
> ok. I have checked over ppc, all defconfigs compile fine. 
> I will send a patch to linuxppc to see how we can merged it 
> in powerpc-next. The other arches would then be checked 
> by the Intel 0-day bot.

Great :)

-- 
Best regards,
Marek Vasut

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

* Re: [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb()
  2017-02-09  9:05   ` Marek Vasut
  2017-02-09  9:59     ` Cédric Le Goater
@ 2017-02-10 18:11     ` Brian Norris
  1 sibling, 0 replies; 10+ messages in thread
From: Brian Norris @ 2017-02-10 18:11 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Cédric Le Goater, linux-mtd, David Woodhouse,
	Boris Brezillon, Richard Weinberger, Cyrille Pitchen

On Thu, Feb 09, 2017 at 10:05:39AM +0100, Marek Vasut wrote:
> On 02/09/2017 12:37 AM, Brian Norris wrote:
> > On Thu, Jan 19, 2017 at 10:13:18AM +0100, Cédric Le Goater wrote:
> >> The first argument of ioread32_rep() and ioread8_rep is not
> >> const. Change aspeed_smc_read_from_ahb() prototype to fix compile
> >> warning :
> >>
> >>    drivers/mtd/spi-nor/aspeed-smc.c: In function 'aspeed_smc_read_from_ahb':
> >>    drivers/mtd/spi-nor/aspeed-smc.c:212:16: warning: passing argument 1 of 'ioread32_rep' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> >>       ioread32_rep(src, buf, len >> 2);
> > 
> > But why isn't that param constant? Seems like that's a bug in the
> > ioread* APIs. Some of their implementations are const, but some are not.
> > 
> > I see for instance that the implementation in lib/iomap.c is not const,
> > where there's zero reason it shouldn't be (if we also fix, e.g., its
> > mmio_insl()).
> 
> Maybe it's worth fixing the ioread*_rep then ? Then again, that seems to
> be way far off the scope of this patch.

To be clear: I agree, it's out of the scope of this patch. I've pulled
this in anyway. But I am happy for any work in the meantime to improve
the consistency here.

Thanks,
Brian

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

end of thread, other threads:[~2017-02-10 18:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-19  9:13 [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb() Cédric Le Goater
2017-01-19 17:21 ` Marek Vasut
2017-01-20 13:11   ` Cyrille Pitchen
2017-02-08 23:37 ` Brian Norris
2017-02-09  9:05   ` Marek Vasut
2017-02-09  9:59     ` Cédric Le Goater
2017-02-09 15:04       ` Marek Vasut
2017-02-10  5:50         ` Cédric Le Goater
2017-02-10 15:09           ` Marek Vasut
2017-02-10 18:11     ` Brian Norris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.