From: Denis Kenzior <denkenz@gmail.com>
To: iwd@lists.01.org
Subject: Re: [PATCH 4/4] scan: Separate cck rates attr creation into logical block
Date: Fri, 08 Nov 2019 20:40:48 -0600 [thread overview]
Message-ID: <e0c2fe7e-ac8e-a987-0db0-e89735f8db02@gmail.com> (raw)
In-Reply-To: <6D926FBC-216A-4512-8040-B0CA569B0754@holtmann.org>
[-- Attachment #1: Type: text/plain, Size: 1051 bytes --]
Hi Marcel,
>> + if (L_WARN_ON(!(supported = wiphy_get_supported_rates(sc->wiphy,
>> + NL80211_BAND_2GHZ,
>> + &num_supported))))
>> + return;
>
> these kind of “nested” statements become really hard to read and check if they are correct.
>
> supported = wiphy_get_supported_rates(sc->wiphy, ..);
> if (L_WARN_ON(!supported))
> return;
>
> I realize that this code is the same as below, but lets improve readability as well. It is fine to submit a cleanup patch to improve readability if we find such places.
Actually, I explicitly requested that this be the way it is. For
L_WARN_ON, I want the resultant warning to carry as much info as
possible. Having a message like "Warning: !supported" show up is pretty
pointless. Yes it carries the line number and filename, but it still
requires an extra step. And things can change between different
versions of iwd, etc.
So while the readability is a little worse, I think the hit is worth it
for cases where L_WARN_ON is used.
Regards,
-Denis
next prev parent reply other threads:[~2019-11-09 2:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 22:03 [PATCH 1/4] scan: Improve comment Tim Kourt
2019-11-08 22:04 ` [PATCH 2/4] scan: Fix bit checking for interworking Tim Kourt
2019-11-08 22:04 ` [PATCH 3/4] scan: Separate IE attr creation into logical block Tim Kourt
2019-11-08 22:04 ` [PATCH 4/4] scan: Separate cck rates " Tim Kourt
2019-11-09 2:06 ` Marcel Holtmann
2019-11-09 2:40 ` Denis Kenzior [this message]
2019-11-09 3:21 ` Marcel Holtmann
2019-11-09 3:33 ` Denis Kenzior
2019-11-09 3:42 ` Marcel Holtmann
2019-11-09 3:46 ` Denis Kenzior
2019-11-09 3:08 ` Denis Kenzior
2019-11-09 3:06 ` [PATCH 1/4] scan: Improve comment Denis Kenzior
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=e0c2fe7e-ac8e-a987-0db0-e89735f8db02@gmail.com \
--to=denkenz@gmail.com \
--cc=iwd@lists.01.org \
/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.