linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luciano Coelho <coelho@ti.com>
To: Eliad Peller <eliad@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wl12xx: use a bitmask instead of list of booleans in scanned_ch
Date: Thu, 31 Mar 2011 10:17:26 +0300	[thread overview]
Message-ID: <1301555846.1988.272.camel@cumari> (raw)
In-Reply-To: <1300779942.2593.398.camel@cumari>

On Tue, 2011-03-22 at 09:45 +0200, Luciano Coelho wrote:
> On Tue, 2011-03-22 at 09:40 +0200, Eliad Peller wrote:
> > On Mon, Mar 21, 2011 at 11:19 PM, Luciano Coelho <coelho@ti.com> wrote:
> > > We were using an array of booleans to mark the channels we had already scanned.  This was causing a sparse error, because bool is not a type with defined size.  To fix this, use bitmasks instead, which is much cleaner anyway.
> > >
> > > Thanks Johannes Berg for the idea.
> > >
> > > Signed-off-by: Luciano Coelho <coelho@ti.com>
> > > ---
> > [...]
> > > +       /* make sure all our channels fit in the scanned_ch bitmask */
> > > +       BUG_ON(ARRAY_SIZE(wl1271_channels) + ARRAY_SIZE(wl1271_channels_5ghz) >
> > > +              WL1271_MAX_CHANNELS);
> > 
> > maybe use BUILD_BUG_ON here?
> 
> Yeah, I had actually done that at first.  But then the compilation error
> was so cryptic that I decided to add a BUG_ON instead.  But now I
> realize that the BUG_ON is just as cryptic, so I can change it back to
> BUILD_BUG_ON.  In either case, the developer will know soon enough that
> there is a bug. :)
> 
> I'll change it to BUILD_BUG_ON before applying.

Applied.

-- 
Cheers,
Luca.


      reply	other threads:[~2011-03-31  7:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21 21:19 [PATCH] wl12xx: use a bitmask instead of list of booleans in scanned_ch Luciano Coelho
2011-03-22  7:40 ` Eliad Peller
2011-03-22  7:45   ` Luciano Coelho
2011-03-31  7:17     ` Luciano Coelho [this message]

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=1301555846.1988.272.camel@cumari \
    --to=coelho@ti.com \
    --cc=eliad@wizery.com \
    --cc=linux-wireless@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;
as well as URLs for NNTP newsgroup(s).