All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Guy, Wey-Yi" <wey-yi.w.guy@intel.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Intel Linux Wireless <ilw@linux.intel.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [RFC 2/4] iwlwifi: always check if got h/w access before write
Date: Tue, 07 Feb 2012 06:20:01 -0800	[thread overview]
Message-ID: <1328624401.7290.49.camel@wwguy-huron> (raw)
In-Reply-To: <20120207080552.GB2246@redhat.com>

On Tue, 2012-02-07 at 09:05 +0100, Stanislaw Gruszka wrote:
> On Mon, Feb 06, 2012 at 08:13:11AM -0800, wwguy wrote:
> > On Mon, 2012-02-06 at 17:09 +0100, Stanislaw Gruszka wrote:
> > > @@ -117,16 +117,17 @@ int iwl_grab_nic_access_silent(struct iwl_bus *bus)
> > >  	return 0;
> > >  }
> > >  
> > > -int iwl_grab_nic_access(struct iwl_bus *bus)
> > > +bool iwl_grab_nic_access(struct iwl_bus *bus)
> > >  {
> > >  	int ret = iwl_grab_nic_access_silent(bus);
> > >  	if (unlikely(ret)) {
> > >  		u32 val = iwl_read32(bus, CSR_GP_CNTRL);
> > >  		WARN_ONCE(1, "Timeout waiting for ucode processor access "
> > >  			     "(CSR_GP_CNTRL 0x%08x)\n", val);
> > > +		return false;
> > >  	}
> > >  
> > > -	return ret;
> > > +	return true;
> > >  }
> > >  u32 iwl_read_direct32(struct iwl_bus *bus, u32 reg);
> > > diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
> > > index 965d047..218071a 100644
> > > --- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
> > > +++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
> > > @@ -443,7 +443,7 @@ static int iwlagn_mac_resume(struct ieee80211_hw *hw)
> > >  	if (iwlagn_hw_valid_rtc_data_addr(base)) {
> > >  		spin_lock_irqsave(&bus(priv)->reg_lock, flags);
> > >  		ret = iwl_grab_nic_access_silent(bus(priv));
> > > -		if (ret == 0) {
> > > +		if (likely(ret == 0)) {
> > 
> > you change the return to bool, right, but "ret" is "int"
> 
> I only changed iwl_grab_nic_access(),
> iwl_grab_nic_access_silent() still returns int.
> 
you are correct, I miss that

Wey



  reply	other threads:[~2012-02-07 15:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-06 16:09 [RFC 1/4] iwlwifi: dump stack when fail to gain access to the device Stanislaw Gruszka
2012-02-06 16:08 ` wwguy
2012-02-07  8:01   ` Stanislaw Gruszka
2012-02-07 14:21     ` Guy, Wey-Yi
2012-02-08 10:52       ` Stanislaw Gruszka
2012-02-06 16:09 ` [RFC 2/4] iwlwifi: always check if got h/w access before write Stanislaw Gruszka
2012-02-06 16:13   ` wwguy
2012-02-07  8:05     ` Stanislaw Gruszka
2012-02-07 14:20       ` Guy, Wey-Yi [this message]
2012-02-06 16:09 ` [RFC 3/4] iwlwifi: cleanup/fix memory barriers Stanislaw Gruszka
2012-02-06 16:13   ` Johannes Berg
2012-02-07  8:11     ` Stanislaw Gruszka
2012-02-07  8:25       ` Johannes Berg
2012-02-06 16:09 ` [RFC 4/4] iwlwifi: use writeb,writel,readl directly Stanislaw Gruszka
2012-02-06 16:32   ` wwguy
2012-02-07  8:22     ` Stanislaw Gruszka
2012-02-07 14:22       ` Guy, Wey-Yi
2012-02-10 12:01 ` [RFC 1/4] iwlwifi: dump stack when fail to gain access to the device Stanislaw Gruszka
2012-02-23 10:14   ` Stanislaw Gruszka

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=1328624401.7290.49.camel@wwguy-huron \
    --to=wey-yi.w.guy@intel.com \
    --cc=ilw@linux.intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sgruszka@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.