From: Christoffer Holmstedt <christoffer@christofferholmstedt.se>
To: Alexander Aring <alex.aring@gmail.com>
Cc: linux-wpan@vger.kernel.org
Subject: Re: [RFC wpan-tools] info: add frequency output to channel listing
Date: Mon, 1 Jun 2015 08:12:44 +0200 [thread overview]
Message-ID: <20150601061244.GA3435@probook-6560b> (raw)
In-Reply-To: <20150531122448.GB1476@omega>
On Sun, May 31, 2015 at 02:24:49PM +0200, Alexander Aring wrote:
> 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
Of course, will fix that.
--
Christoffer Holmstedt
prev parent reply other threads:[~2015-06-01 6:12 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
2015-06-01 6:12 ` Christoffer Holmstedt [this message]
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=20150601061244.GA3435@probook-6560b \
--to=christoffer@christofferholmstedt.se \
--cc=alex.aring@gmail.com \
--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