Search Linux Wireless

Re: [PATCH 2/2] mac80211: Don't use a buf_size=0 in ADDBA requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Helmut Schaa <helmut.schaa@xxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux