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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vcaa0-s6FEUw0YqoEDi=uVRcJiDvwA+ye4cNxwkK6eb+g@mail.gmail.com>
Date:   Mon, 27 Jul 2020 16:07:07 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Vadym Kochan <vadym.kochan@...ision.eu>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Jiri Pirko <jiri@...lanox.com>,
        Ido Schimmel <idosch@...lanox.com>,
        Andrew Lunn <andrew@...n.ch>,
        Oleksandr Mazur <oleksandr.mazur@...ision.eu>,
        Serhiy Boiko <serhiy.boiko@...ision.eu>,
        Serhiy Pshyk <serhiy.pshyk@...ision.eu>,
        Volodymyr Mytnyk <volodymyr.mytnyk@...ision.eu>,
        Taras Chornyi <taras.chornyi@...ision.eu>,
        Andrii Savka <andrii.savka@...ision.eu>,
        netdev <netdev@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Mickey Rachamim <mickeyr@...vell.com>
Subject: Re: [net-next v4 3/6] net: marvell: prestera: Add basic devlink support

On Mon, Jul 27, 2020 at 3:23 PM Vadym Kochan <vadym.kochan@...ision.eu> wrote:
>
> Add very basic support for devlink interface:
>
>     - driver name
>     - fw version
>     - devlink ports

...

> +static int prestera_dl_info_get(struct devlink *dl,
> +                               struct devlink_info_req *req,
> +                               struct netlink_ext_ack *extack)
> +{
> +       struct prestera_switch *sw = devlink_priv(dl);
> +       char buf[16];

> +       int err = 0;

Redundant assignment. When you got a comment the rule of thumb is to
check your entire contribution and address where it's applicable.

> +       err = devlink_info_driver_name_put(req, PRESTERA_DRV_NAME);
> +       if (err)
> +               return err;
> +
> +       snprintf(buf, sizeof(buf), "%d.%d.%d",
> +                sw->dev->fw_rev.maj,
> +                sw->dev->fw_rev.min,
> +                sw->dev->fw_rev.sub);
> +

> +       err = devlink_info_version_running_put(req,
> +                                              DEVLINK_INFO_VERSION_GENERIC_FW,
> +                                              buf);
> +       if (err)
> +               return err;
> +
> +       return 0;

return devlink_...

> +}

...

> +       err = devlink_register(dl, sw->dev->dev);
> +       if (err) {
> +               dev_warn(sw->dev->dev, "devlink_register failed: %d\n", err);
> +               return err;
> +       }
> +
> +       return 0;

  if (err)
    dev_warn(...);

  return err;

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ