From: Jean Sacren <sakiwit@gmail.com>
To: Alexander Aring <alex.aring@gmail.com>
Cc: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
linux-zigbee-devel@lists.sourceforge.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] ieee802154: use helper function to get rid of redundancy
Date: Sun, 1 Jun 2014 11:53:20 -0600 [thread overview]
Message-ID: <20140601175320.GC20143@mail.gmail.com> (raw)
In-Reply-To: <20140601174929.GB20143@mail.gmail.com>
From: Jean Sacren <sakiwit@gmail.com>
Date: Sun, 01 Jun 2014 11:49:29 -0600
>
> From: Alexander Aring <alex.aring@gmail.com>
> Date: Sun, 01 Jun 2014 18:39:28 +0200
> >
> > > You mean something like the following will be less confusing?
> >
> > Yes that's less but there are issues and I don't see any reason why we
> > should do that.
> >
> > >
> > > diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
> > > index 4517b149ed07..06b494bacc44 100644
> > > --- a/drivers/net/ieee802154/at86rf230.c
> > > +++ b/drivers/net/ieee802154/at86rf230.c
> > > @@ -602,20 +602,21 @@ at86rf212_set_channel(struct at86rf230_local *lp, int page, int channel)
> > > {
> > > int rc;
> > >
> > > - if (channel == 0)
> > > - rc = at86rf230_write_subreg(lp, SR_SUB_MODE, 0);
> > > - else
> > > - rc = at86rf230_write_subreg(lp, SR_SUB_MODE, 1);
> > > + if (channel)
> > > + channel = 1;
> > > +
> > > + rc = at86rf230_write_subreg(lp, SR_SUB_MODE, channel);
> > > if (rc < 0)
> > > return rc;
> > >
> >
> > First:
> >
> > This will break the at86rf212_set_channel function. At the end of this
> > function we need the channel parameter and you overwrite it here.
> > At the end of this function stands:
> >
> > "return at86rf230_write_subreg(lp, SR_CHANNEL, channel);"
>
> You are right, but we can:
>
> if (channel)
> rc = 1;
>
> rc = at86rf230_write_subreg(lp, SR_SUB_MODE, rc);
Obviously:
int rc = 0;
prev parent reply other threads:[~2014-06-01 17:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-31 23:39 [PATCH net-next] ieee802154: use helper function to get rid of redundancy Jean Sacren
2014-06-01 7:26 ` Alexander Aring
2014-06-01 14:23 ` Jean Sacren
[not found] ` <20140601142317.GA19754-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-01 14:35 ` Alexander Aring
2014-06-01 15:35 ` Jean Sacren
2014-06-01 16:39 ` Alexander Aring
2014-06-01 17:49 ` Jean Sacren
2014-06-01 17:53 ` Jean Sacren [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=20140601175320.GC20143@mail.gmail.com \
--to=sakiwit@gmail.com \
--cc=alex.aring@gmail.com \
--cc=alex.bluesman.smirnov@gmail.com \
--cc=dbaryshkov@gmail.com \
--cc=linux-zigbee-devel@lists.sourceforge.net \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).