linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luciano Coelho <coelho@ti.com>
To: Kalle Valo <kvalo@adurom.com>
Cc: Eliad Peller <eliad@wizery.com>,
	eyal@wizery.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2 5/7] wl12xx: add RX data filter ACX commands
Date: Tue, 07 Feb 2012 18:11:40 +0200	[thread overview]
Message-ID: <1328631100.7324.272.camel@cumari> (raw)
In-Reply-To: <8739amd3xl.fsf@purkki.adurom.net>

On Tue, 2012-02-07 at 18:05 +0200, Kalle Valo wrote: 
> Luciano Coelho <coelho@ti.com> writes:
> 
> > On Mon, 2012-02-06 at 16:07 +0200, Kalle Valo wrote: 
> >> Luciano Coelho <coelho@ti.com> writes:
> >> 
> >> >> +	if (index >= WL1271_MAX_RX_DATA_FILTERS) {
> >> >> +		wl1271_warning("acx_set_rx_data_filter: invalid filter idx(%d)",
> >> >> +			       index);
> >> >> +		return -EINVAL;
> >> >> +	}
> >> >
> >> > Should we use BUG_ON instead? This is only used internally in the
> >> > driver, so if it get here, it's a bug.  And if the filters come from
> >> > userspace, we should validate them before continuing anyway.
> >> 
> >> BUG_ON() is evil and wireless drivers should really not use it,
> >> WARN_ON_ONCE() and return with an error is much more user friendly.
> >
> > Yeah, BUG_ON() is evil, but sometimes it can be good to have.
> 
> What good does BUG_ON() bring compared to WARN_ON_ONCE()? For example,
> does BUG_ON() even get logged to disk? Most likely not, so
> WARN_ON_ONCE() is much easier to report by the users.
> 
> > I don't agree with "wireless drivers should really not use it". There
> > are 181 occurrences in wireless-testing/master right now[1].
> 
> Then there are 181 misuses of BUG_ON() ;)

:D


> > I'm not saying this measure is either accurate or an excuse to use it
> > where we shouldn't, but it shows that it really has widespread usage
> > in wireless drivers.
> 
> Yes, and that's why I have started a war against misuse of BUG_ON() :)

Okay, I will definitely not be in the frontline against you in this
war. :)


-- 
Cheers,
Luca.


  reply	other threads:[~2012-02-07 16:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31 14:44 [PATCH v2 0/7] wl12xx: add some psm/suspend features Eliad Peller
2012-01-31 14:44 ` [PATCH v2 1/7] wl12xx: Set different wake up conditions in case of suspend Eliad Peller
2012-01-31 14:44 ` [PATCH v2 2/7] wl12xx: add suspend_listen_interval debugfs file Eliad Peller
2012-01-31 14:44 ` [PATCH v2 3/7] wl12xx: add forced_ps mode Eliad Peller
2012-02-02  7:43   ` Luciano Coelho
2012-01-31 14:44 ` [PATCH v2 4/7] wl12xx: add forced_ps debugfs file Eliad Peller
2012-02-02  7:44   ` Luciano Coelho
2012-02-02  8:09     ` Luciano Coelho
2012-01-31 14:44 ` [PATCH v2 5/7] wl12xx: add RX data filter ACX commands Eliad Peller
2012-02-02  8:23   ` Luciano Coelho
2012-02-06 14:07     ` Kalle Valo
2012-02-06 14:32       ` Luciano Coelho
2012-02-07 16:05         ` Kalle Valo
2012-02-07 16:11           ` Luciano Coelho [this message]
2012-01-31 14:44 ` [PATCH v2 6/7] wl12xx: add RX data filters management functions Eliad Peller
2012-02-02  8:39   ` Luciano Coelho
2012-01-31 14:44 ` [PATCH v2 7/7] wl12xx: support wowlan wakeup patterns Eliad Peller
2012-02-02  9:31 ` [PATCH v2 0/7] wl12xx: add some psm/suspend features Luciano Coelho
2012-02-02  9:45   ` Eliad Peller

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=1328631100.7324.272.camel@cumari \
    --to=coelho@ti.com \
    --cc=eliad@wizery.com \
    --cc=eyal@wizery.com \
    --cc=kvalo@adurom.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).