[PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb()

Marek Vasut marek.vasut at gmail.com
Thu Feb 9 01:05:39 PST 2017


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



More information about the linux-mtd mailing list