public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: "Cédric Le Goater" <clg@kaod.org>,
	"Brian Norris" <computersforpeace@gmail.com>
Cc: linux-mtd@lists.infradead.org,
	David Woodhouse <dwmw2@infradead.org>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Richard Weinberger <richard@nod.at>,
	Cyrille Pitchen <cyrille.pitchen@atmel.com>
Subject: Re: [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb()
Date: Fri, 10 Feb 2017 16:09:13 +0100	[thread overview]
Message-ID: <26e67f85-be44-b64e-4d12-fb6cd5c03cb5@gmail.com> (raw)
In-Reply-To: <c8e66f0f-9b83-8192-8a1e-11af03beb350@kaod.org>

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

  reply	other threads:[~2017-02-10 15:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-02-10 18:11     ` Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26e67f85-be44-b64e-4d12-fb6cd5c03cb5@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=clg@kaod.org \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox