All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Mc Guire <der.herr@hofr.at>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Jeff Haran <Jeff.Haran@citrix.com>,
	Valdis.Kletnieks@vt.edu, netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	ath10k@lists.infradead.org, Kalle Valo <kvalo@qca.qualcomm.com>,
	Nicholas Mc Guire <hofrat@osadl.org>,
	Pat Erley <pat-lkml@erley.org>, Bj??rn Mork <bjorn@mork.no>
Subject: Re: [PATCH RFC v2] ath10k: move code from parameter list into a function
Date: Thu, 12 Mar 2015 08:32:30 +0100	[thread overview]
Message-ID: <20150312073230.GA32014@opentech.at> (raw)
In-Reply-To: <5500A58F.3040904@cogentembedded.com>

On Wed, 11 Mar 2015, Sergei Shtylyov wrote:

> Hello.
>
> On 03/11/2015 10:01 PM, Nicholas Mc Guire wrote:
>
>> Putting code into the parameter list of wait_event_timeout() might be
>> legal C-code but not really readable - the "inline" code is simply
>> moved into a function and that passed to wait_event_timeout() as the
>> condition. As wait_event_timeout will always return >= 0 the following
>> timeout check is fixed up to  ret == 0 .
>
>> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> [...]
>
>> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
>> index e8cc19f..a7a12cc 100644
>> --- a/drivers/net/wireless/ath/ath10k/mac.c
>> +++ b/drivers/net/wireless/ath/ath10k/mac.c
>> @@ -4463,11 +4463,25 @@ static int ath10k_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
>>   	return ret;
>>   }
>>
>> +static bool check_htt_state(struct ath10k *ar, bool *skip)
>> +{
>> +	bool empty;
>> +
>> +	spin_lock_bh(&ar->htt.tx_lock);
>> +	empty = (ar->htt.num_pending_tx == 0);
>> +	spin_unlock_bh(&ar->htt.tx_lock);
>> +
>> +	*skip = (ar->state == ATH10K_STATE_WEDGED) ||
>> +		test_bit(ATH10K_FLAG_CRASH_FLUSH,
>> +			 &ar->dev_flags);
>> +	return (empty || *skip);
>
>    Parens not needed here.
>
Thanks - will see what else I forgot and then repost a cleaned up
version.

thx!
hofrat

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

WARNING: multiple messages have this Message-ID (diff)
From: Nicholas Mc Guire <der.herr@hofr.at>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Nicholas Mc Guire <hofrat@osadl.org>,
	Kalle Valo <kvalo@qca.qualcomm.com>,
	Valdis.Kletnieks@vt.edu, Bj??rn Mork <bjorn@mork.no>,
	Jeff Haran <Jeff.Haran@citrix.com>,
	Pat Erley <pat-lkml@erley.org>,
	ath10k@lists.infradead.org, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC v2] ath10k: move code from parameter list into a function
Date: Thu, 12 Mar 2015 08:32:30 +0100	[thread overview]
Message-ID: <20150312073230.GA32014@opentech.at> (raw)
In-Reply-To: <5500A58F.3040904@cogentembedded.com>

On Wed, 11 Mar 2015, Sergei Shtylyov wrote:

> Hello.
>
> On 03/11/2015 10:01 PM, Nicholas Mc Guire wrote:
>
>> Putting code into the parameter list of wait_event_timeout() might be
>> legal C-code but not really readable - the "inline" code is simply
>> moved into a function and that passed to wait_event_timeout() as the
>> condition. As wait_event_timeout will always return >= 0 the following
>> timeout check is fixed up to  ret == 0 .
>
>> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> [...]
>
>> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
>> index e8cc19f..a7a12cc 100644
>> --- a/drivers/net/wireless/ath/ath10k/mac.c
>> +++ b/drivers/net/wireless/ath/ath10k/mac.c
>> @@ -4463,11 +4463,25 @@ static int ath10k_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
>>   	return ret;
>>   }
>>
>> +static bool check_htt_state(struct ath10k *ar, bool *skip)
>> +{
>> +	bool empty;
>> +
>> +	spin_lock_bh(&ar->htt.tx_lock);
>> +	empty = (ar->htt.num_pending_tx == 0);
>> +	spin_unlock_bh(&ar->htt.tx_lock);
>> +
>> +	*skip = (ar->state == ATH10K_STATE_WEDGED) ||
>> +		test_bit(ATH10K_FLAG_CRASH_FLUSH,
>> +			 &ar->dev_flags);
>> +	return (empty || *skip);
>
>    Parens not needed here.
>
Thanks - will see what else I forgot and then repost a cleaned up
version.

thx!
hofrat

  reply	other threads:[~2015-03-12  7:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 19:01 [PATCH RFC v2] ath10k: move code from parameter list into a function Nicholas Mc Guire
2015-03-11 19:01 ` Nicholas Mc Guire
2015-03-11 19:10 ` Johannes Berg
2015-03-11 19:10   ` Johannes Berg
2015-03-11 19:15   ` Nicholas Mc Guire
2015-03-11 19:15     ` Nicholas Mc Guire
2015-03-11 19:22     ` Johannes Berg
2015-03-11 19:22       ` Johannes Berg
2015-03-11 20:29 ` Sergei Shtylyov
2015-03-11 20:29   ` Sergei Shtylyov
2015-03-12  7:32   ` Nicholas Mc Guire [this message]
2015-03-12  7:32     ` Nicholas Mc Guire

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=20150312073230.GA32014@opentech.at \
    --to=der.herr@hofr.at \
    --cc=Jeff.Haran@citrix.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=ath10k@lists.infradead.org \
    --cc=bjorn@mork.no \
    --cc=hofrat@osadl.org \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pat-lkml@erley.org \
    --cc=sergei.shtylyov@cogentembedded.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.