[PATCH] sfc: EFX_ETHTOOL_STAT calculates the offset of the efx##source_name'sfield in both cases

From: Roel Kluin
Date: Tue Jan 19 2010 - 21:08:42 EST


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@xxxxxxxxx>
---
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, \
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/