From: Roel Kluin <roel.kluin@gmail.com>
To: Solarflare linux maintainers <linux-net-drivers@solarflare.com>,
Steve Hodgson <shodgson@solarflare.com>,
Ben Hutchings <bhutchings@solarflare.com>,
netdev@vger.kernel.org, Andrew Mor
Subject: [PATCH] sfc: EFX_ETHTOOL_STAT calculates the offset of the efx##source_name's field in both cases
Date: Wed, 20 Jan 2010 03:08:30 +0100 [thread overview]
Message-ID: <4B56659E.3040001@gmail.com> (raw)
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, \
}
next reply other threads:[~2010-01-20 2:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-20 2:08 Roel Kluin [this message]
2010-01-20 3:12 ` [PATCH] sfc: EFX_ETHTOOL_STAT calculates the offset of the efx##source_name's field in both cases Ben Hutchings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B56659E.3040001@gmail.com \
--to=roel.kluin@gmail.com \
--cc=bhutchings@solarflare.com \
--cc=linux-net-drivers@solarflare.com \
--cc=netdev@vger.kernel.org \
--cc=shodgson@solarflare.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).