linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: Pavel Roskin <proski@gnu.org>
Cc: Ming Lei <tom.leiming@gmail.com>,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Luis Rodriguez <Luis.Rodriguez@Atheros.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"ath9k-devel@lists.ath9k.org" <ath9k-devel@lists.ath9k.org>,
	"linville@tuxdriver.com" <linville@tuxdriver.com>,
	"johannes@sipsolutions.net" <johannes@sipsolutions.net>
Subject: Re: [PATCH] ath9k: decrease size of ath9k.ko
Date: Wed, 3 Mar 2010 16:54:33 -0800	[thread overview]
Message-ID: <20100304005433.GA8410@tux> (raw)
In-Reply-To: <1267592564.4725.11.camel@mj>

On Tue, Mar 02, 2010 at 09:02:44PM -0800, Pavel Roskin wrote:
> On Mon, 2010-03-01 at 23:13 +0800, Ming Lei wrote:
> > -		int valid;
> > -		int valid_single_stream;
> > +		u8 valid;
> > +		u8 valid_single_stream;
> 
> You can use bool instead, and that would give the same size saving while
> being even more descriptive.  I think using bool could be safer, as the
> compiler would be able to detect some misuses and the values.
> 
> But I could get even more saving by using bool with the field width:
> 
> bool valid:1;
> bool valid_single_stream:1;
> 
> That would place both variables into one byte.  It may be ineffective
> for speed, but it's more effective for storage.
> 
> In my configuration, I get following sizes:
> 
> original (int):    2792138
> your patch (u8):   2790186
> bool:              2790186
> bool (1 bit):      2789218

Or use flags, and use BIT(1), BIT(2), etc for #defines for each stream mode.
Would save even more.

  Luis

  reply	other threads:[~2010-03-04  0:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-27 16:56 [PATCH] ath9k: decrease size of ath9k.ko tom.leiming
2010-02-27 17:10 ` Larry Finger
2010-02-28  2:52   ` Ming Lei
2010-02-28  3:19     ` Larry Finger
2010-03-01 15:13       ` Ming Lei
2010-03-03  5:02         ` Pavel Roskin
2010-03-04  0:54           ` Luis R. Rodriguez [this message]
2010-03-06 14:47           ` Ming Lei
2010-03-01 12:19     ` Holger Schurig
2010-03-10 23:52 ` [stable] " Greg KH
2010-03-11  0:42   ` Luis R. Rodriguez

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=20100304005433.GA8410@tux \
    --to=lrodriguez@atheros.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=Luis.Rodriguez@Atheros.com \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=proski@gnu.org \
    --cc=tom.leiming@gmail.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).