proper way to deal with a sparse warning (fwd)

From: Kumar Gala <hidden>
Date: 2006-01-23 16:28:55
Also in: lkml

I wasn't getting much of a response on lkml to this, so maybe netdev will 
be more helpful :)

thanks

- kumar

---------- Forwarded message ----------
Date: Thu, 19 Jan 2006 00:19:47 -0600
From: Kumar Gala <redacted>
To: LKML List <redacted>
Subject: proper way to deal with a sparse warning

I'm getting the following sparse warning:

drivers/net/gianfar_mii.c:165:16: warning: incorrect type in  
assignment (different address spaces)
drivers/net/gianfar_mii.c:165:16:    expected void *priv
drivers/net/gianfar_mii.c:165:16:    got struct gfar_mii [noderef] * 
[assigned] regs<asn:2>

This is line 165 of gianfar_mii.c:

         new_bus->priv = regs;

new_bus->priv is of type void *.  regs is of type struct gfar_mii  
__iomem *.

Is it acceptable to do the following:

	new_bus->priv = (void __force *)regs;

- kumar
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help