From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf0-f194.google.com ([209.85.192.194]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cbbp6-0000AE-Vu for linux-mtd@lists.infradead.org; Wed, 08 Feb 2017 23:38:54 +0000 Received: by mail-pf0-f194.google.com with SMTP id y143so12412032pfb.1 for ; Wed, 08 Feb 2017 15:38:32 -0800 (PST) Date: Wed, 8 Feb 2017 15:37:28 -0800 From: Brian Norris To: =?iso-8859-1?Q?C=E9dric?= Le Goater Cc: linux-mtd@lists.infradead.org, David Woodhouse , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen Subject: Re: [PATCH] mtd: aspeed: fix compile warning in aspeed_smc_read_from_ahb() Message-ID: <20170208233728.GN94627@google.com> References: <1484817198-22477-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1484817198-22477-1-git-send-email-clg@kaod.org> List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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