Bug 29432

Summary: drivers/net/igbvf/igbvf.h: duplicate member page
Product: Networking Reporter: Török Edwin (edwin+bugs)
Component: OtherAssignee: Arnaldo Carvalho de Melo (acme)
Status: RESOLVED CODE_FIX    
Severity: normal CC: akpm
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description Török Edwin 2011-02-19 11:42:33 UTC
clang reports:

In file included from drivers/net/igbvf/ethtool.c:36:
drivers/net/igbvf/igbvf.h:129:15: error: duplicate member 'page'
        struct page *page;
                     ^
drivers/net/igbvf/igbvf.h:124:17: note: previous declaration is here
                        struct page *page;
                                     ^

Indeed the field is duplicate:
struct igbvf_buffer {
	dma_addr_t dma;
	struct sk_buff *skb;
	union {
		/* Tx */
		struct {
			unsigned long time_stamp;
			u16 length;
			u16 next_to_watch;
			u16 mapped_as_page;
		};
		/* Rx */
		struct {
			struct page *page;
			u64 page_dma;
			unsigned int page_offset;
		};
	};
	struct page *page;
};

GCC seems to prefer accessing the first 'page', so should the 2nd page be renamed to "dummy_page", since you have no way of accessing it?
Comment 1 Andrew Morton 2011-02-23 01:13:33 UTC
Fixed in 2.6.38-rcX, but not fixed in 2.6.37.x.  Please let us know if you think the fix should be backported and if so, why?
Comment 2 Török Edwin 2011-02-23 10:00:19 UTC
Sorry, should've checked that it is already fixed in the -rc.
No need to backport.