lkml.org 
[lkml]   [2020]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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@plvision.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

\
 
 \ /
  Last update: 2020-07-27 15:07    [W:0.211 / U:1.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site