Bug 29432 - drivers/net/igbvf/igbvf.h: duplicate member page
drivers/net/igbvf/igbvf.h: duplicate member page
Status: RESOLVED CODE_FIX
Product: Networking
Classification: Unclassified
Component: Other
All Linux
: P1 normal
Assigned To: Arnaldo Carvalho de Melo
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-19 11:42 UTC by Török Edwin
Modified: 2011-02-23 10:00 UTC (History)
1 user (show)

See Also:
Kernel Version:
Tree: Mainline
Regression: No


Attachments

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.

Note You need to log in before you can comment on or make changes to this bug.