From: Alexander Aring <alex.aring@gmail.com>
To: Christoffer Holmstedt <christoffer@christofferholmstedt.se>
Cc: linux-wpan@vger.kernel.org
Subject: Re: [RFC wpan-tools] info: add frequency output to channel listing
Date: Sun, 31 May 2015 14:24:49 +0200 [thread overview]
Message-ID: <20150531122448.GB1476@omega> (raw)
In-Reply-To: <20150529121556.GA7422@raspberrypi>
On Fri, May 29, 2015 at 12:16:03PM +0000, Christoffer Holmstedt wrote:
>
> if (tb_msg[NL802154_ATTR_CHANNEL])
> - printf("current_channel: %d\n", nla_get_u8(tb_msg[NL802154_ATTR_CHANNEL]));
> + {
> + unsigned char curr_channel;
> + curr_channel = nla_get_u8(tb_msg[NL802154_ATTR_CHANNEL]);
> + printf("current_channel: %d (", curr_channel);
> + print_freq(nla_get_u8(tb_msg[NL802154_ATTR_PAGE]), curr_channel);
Also this is problematic, because we don't check before if
tb_msg[NL802154_ATTR_PAGE] isn't null.
When you like to use this value there, the easiest way would be:
if (tb_msg[NL802154_ATTR_CHANNEL] && tb_msg[NL802154_ATTR_PAGE])
instead of
if (tb_msg[NL802154_ATTR_CHANNEL]) above.
- Alex
next prev parent reply other threads:[~2015-05-31 12:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 12:16 [RFC wpan-tools] info: add frequency output to channel listing Christoffer Holmstedt
2015-05-31 11:37 ` Alexander Aring
2015-06-01 8:02 ` Christoffer Holmstedt
2015-05-31 12:24 ` Alexander Aring [this message]
2015-06-01 6:12 ` Christoffer Holmstedt
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=20150531122448.GB1476@omega \
--to=alex.aring@gmail.com \
--cc=christoffer@christofferholmstedt.se \
--cc=linux-wpan@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox