Linux-WPAN Archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <aahringo@redhat.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Alexander Aring <alex.aring@gmail.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	linux-wpan@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	netdev@vger.kernel.org, David Girault <david.girault@qorvo.com>,
	Romuald Despres <romuald.despres@qorvo.com>,
	Frederic Blain <frederic.blain@qorvo.com>,
	Nicolas Schodet <nico@ni.fr.eu.org>,
	Guilhem Imberton <guilhem.imberton@qorvo.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH wpan-next v4 02/11] ieee802154: Internal PAN management
Date: Thu, 28 Sep 2023 20:22:04 -0400	[thread overview]
Message-ID: <CAK-6q+iWit1KoHfz-sQOLD3MiONcaHXAJHbL02V3srLx4C7X2Q@mail.gmail.com> (raw)
In-Reply-To: <20230927175635.2404e28a@xps-13>

Hi,

On Wed, Sep 27, 2023 at 12:10 PM Miquel Raynal
<miquel.raynal@bootlin.com> wrote:
>
> Hi Alexander,
>
> > > +
> > > +#include <linux/kernel.h>
> > > +#include <net/cfg802154.h>
> > > +#include <net/af_ieee802154.h>
> > > +
> > > +/* Checks whether a device address matches one from the PAN list.
> > > + * This helper is meant to be used only during PAN management, when we expect
> > > + * extended addresses to be used.
> > > + */
> > > +static bool cfg802154_device_in_pan(struct ieee802154_pan_device *pan_dev,
> > > +                                   struct ieee802154_addr *ext_dev)
> > > +{
> > > +       if (!pan_dev || !ext_dev)
> > > +               return false;
> > > +
> > > +       if (ext_dev->mode == IEEE802154_ADDR_SHORT)
> > > +               return false;
> > > +
> > > +       switch (ext_dev->mode) {
> > > +       case IEEE802154_ADDR_SHORT:
> > > +               return pan_dev->short_addr == ext_dev->short_addr;
> >
> > This is dead code now, it will never be reached, it's checked above
> > (Or I don't see it)? I want to help you here. What exactly do you try
> > to reach here again?
>
> It's a left over. All association/disassociation operation so far which
> need these checks are operated using extended addressing (from the
> spec). I will simplify further this helper.
>

I see, it makes sense to me.

>
> > > +bool cfg802154_device_is_parent(struct wpan_dev *wpan_dev,
> > > +                               struct ieee802154_addr *target)
> > > +{
> > > +       lockdep_assert_held(&wpan_dev->association_lock);
> > > +
> > > +       if (cfg802154_device_in_pan(wpan_dev->parent, target))
> > > +               return true;
> > > +
> > > +       return false;
> >
> > return cfg802154_device_in_pan(...); Why isn't checkpatch warning about that?
>
> checkpatch does not care I guess, but I can definitely simplify this
> return path as well, you're right.
>

ok. Was a nitpick.

Thanks.

- Alex


  reply	other threads:[~2023-09-29  0:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 15:50 [PATCH wpan-next v4 00/11] ieee802154: Associations between devices Miquel Raynal
2023-09-22 15:50 ` [PATCH wpan-next v4 01/11] ieee802154: Let PAN IDs be reset Miquel Raynal
2023-09-24 20:42   ` Alexander Aring
2023-09-25  7:34     ` Miquel Raynal
2023-09-22 15:50 ` [PATCH wpan-next v4 02/11] ieee802154: Internal PAN management Miquel Raynal
2023-09-24 20:47   ` Alexander Aring
2023-09-27 16:10     ` Miquel Raynal
2023-09-29  0:22       ` Alexander Aring [this message]
2023-09-22 15:50 ` [PATCH wpan-next v4 03/11] ieee802154: Add support for user association requests Miquel Raynal
2023-09-22 15:50 ` [PATCH wpan-next v4 04/11] mac802154: Handle associating Miquel Raynal
2023-09-25 11:35   ` kernel test robot
2023-09-22 15:50 ` [PATCH wpan-next v4 05/11] ieee802154: Add support for user disassociation requests Miquel Raynal
2023-09-22 15:50 ` [PATCH wpan-next v4 06/11] mac802154: Handle disassociations Miquel Raynal
2023-09-22 15:50 ` [PATCH wpan-next v4 07/11] mac802154: Handle association requests from peers Miquel Raynal
2023-09-25  0:13   ` Alexander Aring
2023-09-25  7:43     ` Miquel Raynal
2023-09-27  1:31       ` Alexander Aring
2023-09-27 14:39         ` Miquel Raynal
2023-09-27  1:37   ` Alexander Aring
2023-09-27 15:40     ` Miquel Raynal
2023-09-29  0:19       ` Alexander Aring
2023-09-22 15:50 ` [PATCH wpan-next v4 08/11] ieee802154: Add support for limiting the number of associated devices Miquel Raynal
2023-09-22 15:50 ` [PATCH wpan-next v4 09/11] mac802154: Follow " Miquel Raynal
2023-09-22 15:50 ` [PATCH wpan-next v4 10/11] mac802154: Handle disassociation notifications from peers Miquel Raynal
2023-09-22 15:50 ` [PATCH wpan-next v4 11/11] ieee802154: Give the user the association list Miquel Raynal

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=CAK-6q+iWit1KoHfz-sQOLD3MiONcaHXAJHbL02V3srLx4C7X2Q@mail.gmail.com \
    --to=aahringo@redhat.com \
    --cc=alex.aring@gmail.com \
    --cc=davem@davemloft.net \
    --cc=david.girault@qorvo.com \
    --cc=edumazet@google.com \
    --cc=frederic.blain@qorvo.com \
    --cc=guilhem.imberton@qorvo.com \
    --cc=kuba@kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=nico@ni.fr.eu.org \
    --cc=pabeni@redhat.com \
    --cc=romuald.despres@qorvo.com \
    --cc=stefan@datenfreihafen.org \
    --cc=thomas.petazzoni@bootlin.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).