ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: Re: [PATCH v2 2/2] ath10k: refactor radar detection code
Date: Tue, 8 Apr 2014 10:04:05 +0300	[thread overview]
Message-ID: <87fvlomhei.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CA+BoTQ=-vrJ_tize+uwCp5jgM7pvPZ0s9bGUK42Ko1TCHzmfzg@mail.gmail.com> (Michal Kazior's message of "Tue, 8 Apr 2014 08:32:58 +0200")

Michal Kazior <michal.kazior@tieto.com> writes:

>> Even though this is correct, I think it's still a bit evil. For example,
>> I missed '!' the first time I looked at this. Even this is a line
>> longer, I think it would be easier to read:
>>
>> WARN_ON(ar->num_started_vdevs == 0);
>>
>> if (ar->num_started_vdevs != 0) {
>>         ...
>> }
>
> Sound reasonably.

I changed it like this now:

--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -878,7 +878,9 @@ static int ath10k_vdev_stop(struct ath10k_vif *arvif)
                return ret;
        }
 
-       if (!WARN_ON(ar->num_started_vdevs == 0)) {
+       WARN_ON(ar->num_started_vdevs == 0);
+
+       if (ar->num_started_vdevs != 0) {
                ar->num_started_vdevs--;
                ath10k_recalc_radar_detection(ar);

Full patch here:

https://github.com/kvalo/ath/commit/0d57ff8b99539895c5a3714d7ecd80a58b6a8928

-- 
Kalle Valo

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

  reply	other threads:[~2014-04-08  7:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1396015934-7723-1-git-send-email-michal.kazior@tieto.com>
2014-04-01  7:25 ` [PATCH] ath10k: fix initial radar detection logic Michal Kazior
2014-04-02  5:27   ` Kalle Valo
2014-04-02  5:48     ` Michal Kazior
2014-04-04 11:28   ` [PATCH v2 0/2] ath10k: fix radar/cac Michal Kazior
2014-04-04 11:28     ` [PATCH v2 1/2] ath10k: reorder functions Michal Kazior
2014-04-07 13:52       ` Kalle Valo
2014-04-08  6:07         ` Michal Kazior
2014-04-04 11:28     ` [PATCH v2 2/2] ath10k: refactor radar detection code Michal Kazior
2014-04-07 14:04       ` Kalle Valo
2014-04-08  6:32         ` Michal Kazior
2014-04-08  7:04           ` Kalle Valo [this message]
2014-04-11  5:25     ` [PATCH v2 0/2] ath10k: fix radar/cac Kalle Valo

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=87fvlomhei.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@qca.qualcomm.com \
    --cc=ath10k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=michal.kazior@tieto.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