netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sfc: EFX_ETHTOOL_STAT calculates the offset of the efx##source_name's field in both cases
@ 2010-01-20  2:08 Roel Kluin
  2010-01-20  3:12 ` Ben Hutchings
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2010-01-20  2:08 UTC (permalink / raw)
  To: Solarflare linux maintainers, Steve Hodgson, Ben Hutchings,
	netdev, Andrew 

EFX_ETHTOOL_STAT calculated the offset of the efx##source_name's field
Regardless of whether that field was NULL.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
This looks like a bug, but I am not sure whether I understood this correctly,
nor was it tested, was this intended?

diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index 6c0bbed..722bac7 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -41,7 +41,7 @@ struct efx_ethtool_stat {
 	.source = EFX_ETHTOOL_STAT_SOURCE_##source_name,		\
 	.offset = ((((field_type *) 0) ==				\
 		      &((struct efx_##source_name *)0)->field) ?	\
-		    offsetof(struct efx_##source_name, field) :		\
+		    offsetof(struct efx_##stat_name, field) :		\
 		    offsetof(struct efx_##source_name, field)),		\
 	.get_stat = get_stat_function,					\
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-20  3:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20  2:08 [PATCH] sfc: EFX_ETHTOOL_STAT calculates the offset of the efx##source_name's field in both cases Roel Kluin
2010-01-20  3:12 ` Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).