On 01/14/2014 03:47 AM, Michael S. Tsirkin wrote:
On Mon, Jan 13, 2014 at 06:52:06PM -0800, Guenter Roeck wrote:
Hi Greg,

I get the following new build failure for 3.10 and 3.12.
Affected are m68k:allmodconfig and sparc64:allmodconfig.

drivers/net/virtio_net.c: In function 'receive_mergeable':
drivers/net/virtio_net.c:330:29: warning: dereferencing 'void *' pointer 
[enabled by default]
drivers/net/virtio_net.c:330:29: error: request for member 'virtual' in 
something not a structure or union

Culprit is "virtio_net: fix error handling for mergeable buffers".
Problem is that "page_address" is assumed to be a function,
but that is not always the case, at least not in 3.10 and 3.12.

Guenter

I see. You are right, it's a macro on some architectures.
The following should fix this problem (on top).
Can you confirm please?

-       struct skb_vnet_hdr *hdr = page_address(buf);
-       int num_buf = hdr->mhdr.num_buffers;
-       struct page *page = buf;
+       struct page *page = buf;
+       struct skb_vnet_hdr *hdr = page_address(page);
+       int num_buf = hdr->mhdr.num_buffers;

If this is confirmed to help I'll send a proper patch.
Thanks!


Or you could just typecast buf.

The upstream code looks completely different, btw. Am I missing something ?

Guenter

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to