From: Johannes Berg <johannes@sipsolutions.net>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 3/3] net: Dynamically allocate struct station_info
Date: Wed, 09 May 2018 23:33:45 +0200 [thread overview]
Message-ID: <1525901625.6910.33.camel@sipsolutions.net> (raw)
In-Reply-To: <152586802515.18089.12700714478750075562.stgit@alrua-kau> (sfid-20180509_141355_857728_4EC9B802)
> WARN_ON is used where the function has no way to signal errors to the
> caller.
There isn't really much point in that - failing allocations are already
*very* noisy. Please respin with that removed (and then I guess you can
fix the Fixes: too)
You didn't actually do that in this patch though :-)
johannes
> + bool filled;
> int ret;
>
> /* if the user specified a customised value for this interface, then
> @@ -102,7 +103,17 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh)
> if (!real_netdev)
> goto default_throughput;
>
> - ret = cfg80211_get_station(real_netdev, neigh->addr, &sinfo);
> + sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
> + if (!sinfo)
> + goto default_throughput;
> +
> + ret = cfg80211_get_station(real_netdev, neigh->addr, sinfo);
> +
> + /* just save these here instead of having complex free logic below */
> + throughput = sinfo.expected_throughput / 100;
> + filled = !!(sinfo.filled & BIT(NL80211_STA_INFO_EXPECTED_THROUGHPUT));
It's bool so you don't need the !!(...) :-)
johannes
next prev parent reply other threads:[~2018-05-09 21:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-09 12:13 [PATCH 1/3] wireless-drivers: Dynamically allocate struct station_info Toke Høiland-Jørgensen
2018-05-09 12:13 ` [PATCH 3/3] net: " Toke Høiland-Jørgensen
2018-05-09 21:33 ` Johannes Berg [this message]
2018-05-09 21:36 ` Toke Høiland-Jørgensen
2018-05-09 22:55 ` kbuild test robot
2018-05-09 23:07 ` Toke Høiland-Jørgensen
2018-05-10 0:06 ` kbuild test robot
2018-05-09 12:13 ` [PATCH 2/3] staging: " Toke Høiland-Jørgensen
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=1525901625.6910.33.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=toke@toke.dk \
/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.