linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: Ming Lei <tom.leiming@gmail.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	lrodriguez@atheros.com, linux-wireless@vger.kernel.org,
	ath9k-devel@lists.ath9k.org, linville@tuxdriver.com,
	johannes@sipsolutions.net
Subject: Re: [PATCH] ath9k: decrease size of ath9k.ko
Date: Wed, 03 Mar 2010 00:02:44 -0500	[thread overview]
Message-ID: <1267592564.4725.11.camel@mj> (raw)
In-Reply-To: <20100301231329.64e3dd3b@tom-lei>

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

-- 
Regards,
Pavel Roskin

  reply	other threads:[~2010-03-03  5:02 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 [this message]
2010-03-04  0:54           ` Luis R. Rodriguez
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=1267592564.4725.11.camel@mj \
    --to=proski@gnu.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=lrodriguez@atheros.com \
    --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).