lkml.org 
[lkml]   [2017]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/12] nvmem: qfprom: fix different address space warnings of sparse
On Mon, Oct 09, 2017 at 03:26:33PM +0200, srinivas.kandagatla@linaro.org wrote:
> From: Masahiro Yamada <yamada.masahiro@socionext.com>
>
> Fix the following sparse warnings:
>
> drivers/nvmem/qfprom.c:23:30: warning: incorrect type in initializer (different address spaces)
> drivers/nvmem/qfprom.c:23:30: expected void [noderef] <asn:2>*base
> drivers/nvmem/qfprom.c:23:30: got void *context
> drivers/nvmem/qfprom.c:36:30: warning: incorrect type in initializer (different address spaces)
> drivers/nvmem/qfprom.c:36:30: expected void [noderef] <asn:2>*base
> drivers/nvmem/qfprom.c:36:30: got void *context
> drivers/nvmem/qfprom.c:76:22: warning: incorrect type in assignment (different address spaces)
> drivers/nvmem/qfprom.c:76:22: expected void *static [toplevel] [assigned] priv
> drivers/nvmem/qfprom.c:76:22: got void [noderef] <asn:2>*[assigned] base
>
> The type of nvmem_config->priv is (void *), so sparse complains
> about assignment of the base address with (void __iomem *) type.
>
> Even if we cast it out, sparse still warns:
> warning: cast removes address space of expression
>
> Of course, we can shut up the sparse by marking __force, but a more
> correct way is to put the base address into driver private data.

Same objection here. Don't hide things like this.

greg k-h

\
 
 \ /
  Last update: 2017-10-22 17:40    [W:0.443 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site