From: Kalle Valo <kvalo@adurom.com>
To: Helmut Schaa <helmut.schaa@googlemail.com>
Cc: John Linville <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org,
Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH 2/2] mac80211: Don't use a buf_size=0 in ADDBA requests
Date: Fri, 05 Aug 2011 11:54:34 +0300 [thread overview]
Message-ID: <874o1ws0fp.fsf@purkki.adurom.net> (raw)
In-Reply-To: <4365125.pkzJgJtRz2@helmutmobil.site> (Helmut Schaa's message of "Fri\, 05 Aug 2011 10\:35\:39 +0200")
Helmut Schaa <helmut.schaa@googlemail.com> writes:
>> Also " ? :" inside a function call is not readable IMHO,
>> maybe instead a separate variable with if() statements?
>
> Hmm, in this particular case it looks like overkill to me to use a
> separate variable.
To me it's overkill to optimise few lines with the cost of
readibility. Example:
ieee80211_send_addba_request(sdata, sta->sta.addr, tid,
tid_tx->dialog_token, start_seq_num,
local->hw.max_tx_aggregation_subframes ?
local->hw.max_tx_aggregation_subframes :
IEEE80211_MAX_AMPDU_BUF,
tid_tx->timeout);
vs.
ampdu_len = local->hw.max_tx_aggregation_subframes
if (ampdu_len == 0)
ampdu_len = IEEE80211_MAX_AMPDU_BUF;
ieee80211_send_addba_request(sdata, sta->sta.addr, tid,
tid_tx->dialog_token, start_seq_num,
ampdu_len,
tid_tx->timeout);
So only three lines more (plus the variable declaration) but the code
is simpler to read because the if statement is not embedded to the
function call parameters.
But as always, people have different views about coding styles :)
--
Kalle Valo
next prev parent reply other threads:[~2011-08-05 8:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-26 10:18 [PATCH 1/2] mac80211: Stop TX BA session if buf_size is zero Helmut Schaa
2011-07-26 10:18 ` [PATCH 2/2] mac80211: Don't use a buf_size=0 in ADDBA requests Helmut Schaa
2011-08-05 8:15 ` Kalle Valo
2011-08-05 8:35 ` Helmut Schaa
2011-08-05 8:54 ` Kalle Valo [this message]
2011-08-05 9:46 ` [PATCHv2 " Helmut Schaa
2011-08-08 8:29 ` Johannes Berg
2011-08-08 8:40 ` Helmut Schaa
2011-08-08 8:46 ` Johannes Berg
2011-08-08 8:50 ` [PATCH 1/2] mac80211: Stop TX BA session if buf_size is zero Johannes Berg
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=874o1ws0fp.fsf@purkki.adurom.net \
--to=kvalo@adurom.com \
--cc=helmut.schaa@googlemail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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