lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 18 May 2021 12:31:39 +0200
From:   Loic Poulain <loic.poulain@...aro.org>
To:     Sergey Ryazanov <ryazanov.s.a@...il.com>
Cc:     Jakub Kicinski <kuba@...nel.org>,
        David Miller <davem@...emloft.net>,
        Network Development <netdev@...r.kernel.org>,
        dcbw@...ps.redhat.com,
        Aleksander Morgado <aleksander@...ksander.es>
Subject: Re: [PATCH net] net: wwan: Add WWAN port type attribute

Hi Sergey,

On Tue, 18 May 2021 at 01:44, Sergey Ryazanov <ryazanov.s.a@...il.com> wrote:
>
> Hello Loic,
>
> On Mon, May 17, 2021 at 12:48 PM Loic Poulain <loic.poulain@...aro.org> wrote:
> > The port type is by default part of the WWAN port device name.
> > However device name can not be considered as a 'stable' API and
> > may be subject to change in the future. This change adds a proper
> > device attribute that can be used to determine the WWAN protocol/
> > type.
> >
> > Signed-off-by: Loic Poulain <loic.poulain@...aro.org>
> > ---
> >  drivers/net/wwan/wwan_core.c | 34 +++++++++++++++++++++++++---------
> >  1 file changed, 25 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c
> > index cff04e5..92a8a6f 100644
> > --- a/drivers/net/wwan/wwan_core.c
> > +++ b/drivers/net/wwan/wwan_core.c
> > @@ -169,6 +169,30 @@ static void wwan_remove_dev(struct wwan_device *wwandev)
> >
> >  /* ------- WWAN port management ------- */
> >
> > +/* Keep aligned with wwan_port_type enum */
> > +static const char * const wwan_port_type_str[] = {
> > +       "AT",
> > +       "MBIM",
> > +       "QMI",
> > +       "QCDM",
> > +       "FIREHOSE"
> > +};
>
> A small nitpick, maybe this array should be defined in a such way:
>
> static const char * const wwan_port_type_str[WWAN_PORT_MAX] = {
>     [WWAN_PORT_AT] = "AT",
>     [WWAN_PORT_MBIM] = "MBIM",
>     [WWAN_PORT_QMI] = "QMI",
>     [WWAN_PORT_QCDM] = "QCDM",
>     [WWAN_PORT_FIREHOSE] = "FIREHOSE",
> };
>
> So the array index will be clear without additional notes.

You're right, it would indeed be more robust.
I'll submit that change in a subsequent patch.

Thanks,
Loic

>
> --
> Sergey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ