Netdev List
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: <netdev@vger.kernel.org>
Cc: <linux-net-drivers@solarflare.com>,
	David Laight <David.Laight@ACULAB.COM>
Subject: [PATCH ethtool] sfc: Stop using bitfields in register definition structures
Date: Mon, 23 Sep 2013 19:14:58 +0100	[thread overview]
Message-ID: <1379960098.2485.48.camel@bwh-desktop.uk.level5networks.com> (raw)

This doesn't make any difference to the static data size, and
decreases the code size a little.

Reported-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 sfc.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/sfc.c b/sfc.c
index 2e15f52..1bb3689 100644
--- a/sfc.c
+++ b/sfc.c
@@ -2562,8 +2562,8 @@
 
 struct efx_nic_reg_field {
 	const char *name;
-	u32 lbn:7, width:8;
-	u32 min_revision:3, max_revision:3;
+	u8 lbn, width;
+	u8 min_revision, max_revision;
 };
 
 #define REGISTER_FIELD_RENAME(name, display_name, arch, min_rev, max_rev) { \
@@ -3545,8 +3545,8 @@ static const struct efx_nic_reg_field efx_nic_reg_fields_BIU_MC_SFT_STATUS[] = {
 struct efx_nic_reg {
 	const char *name;
 	const struct efx_nic_reg_field *fields;
-	u32 field_count:7;
-	u32 min_revision:3, max_revision:3;
+	u8 field_count;
+	u8 min_revision, max_revision;
 };
 
 #define REGISTER(name, arch, min_rev, max_rev) {			\
@@ -3677,9 +3677,10 @@ static const struct efx_nic_reg efx_nic_regs[] = {
 struct efx_nic_reg_table {
 	const char *name;
 	const struct efx_nic_reg_field *fields;
-	u32 field_count:7;
-	u32 min_revision:3, max_revision:3;
-	u32 step:6, rows:21;
+	u8 field_count;
+	u8 min_revision, max_revision;
+	u8 step;
+	u32 rows;
 };
 
 #define REGISTER_TABLE_DIMENSIONS(name, _, arch, min_rev, max_rev, step, rows) { \
-- 
1.8.1.4


-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

             reply	other threads:[~2013-09-23 18:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-23 18:14 Ben Hutchings [this message]
2013-10-01 15:37 ` [PATCH ethtool] sfc: Stop using bitfields in register definition structures 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=1379960098.2485.48.camel@bwh-desktop.uk.level5networks.com \
    --to=bhutchings@solarflare.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=linux-net-drivers@solarflare.com \
    --cc=netdev@vger.kernel.org \
    /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