From: Vadym Kochan <vadym.kochan@plvision.eu>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@mellanox.com>,
Ido Schimmel <idosch@mellanox.com>, Andrew Lunn <andrew@lunn.ch>,
Oleksandr Mazur <oleksandr.mazur@plvision.eu>,
Serhiy Boiko <serhiy.boiko@plvision.eu>,
Serhiy Pshyk <serhiy.pshyk@plvision.eu>,
Volodymyr Mytnyk <volodymyr.mytnyk@plvision.eu>,
Taras Chornyi <taras.chornyi@plvision.eu>,
Andrii Savka <andrii.savka@plvision.eu>,
netdev <netdev@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Mickey Rachamim <mickeyr@marvell.com>
Subject: Re: [net-next v4 3/6] net: marvell: prestera: Add basic devlink support
Date: Tue, 28 Jul 2020 15:30:06 +0300 [thread overview]
Message-ID: <20200728123006.GA10391@plvision.eu> (raw)
In-Reply-To: <CAHp75Vcaa0-s6FEUw0YqoEDi=uVRcJiDvwA+ye4cNxwkK6eb+g@mail.gmail.com>
Hi Andy,
On Mon, Jul 27, 2020 at 04:07:07PM +0300, Andy Shevchenko wrote:
> 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;
Would not it better to have 'return 0' at the end to visually indicate
the success point ?
>
> --
> With Best Regards,
> Andy Shevchenko
Thanks!
next prev parent reply other threads:[~2020-07-28 12:30 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-27 12:22 [net-next v4 0/6] net: marvell: prestera: Add Switchdev driver for Prestera family ASIC device 98DX326x (AC3x) Vadym Kochan
2020-07-27 12:22 ` [net-next v4 1/6] net: marvell: prestera: Add driver for Prestera family ASIC devices Vadym Kochan
2020-07-27 12:59 ` Andy Shevchenko
2020-07-31 15:22 ` Vadym Kochan
2020-07-31 16:02 ` Andy Shevchenko
2020-07-31 20:55 ` Vadym Kochan
2020-07-27 19:32 ` David Miller
2020-08-13 8:03 ` Jonathan McDowell
2020-08-14 8:20 ` Vadym Kochan
2020-08-14 12:05 ` Jonathan McDowell
2020-08-14 12:27 ` Vadym Kochan
2020-08-14 13:18 ` Andrew Lunn
2020-08-20 8:31 ` Vadym Kochan
2020-08-20 10:00 ` [EXT] " Mickey Rachamim
2020-08-22 16:34 ` Andrew Lunn
2020-08-25 11:36 ` Vadym Kochan
2020-07-27 12:22 ` [net-next v4 2/6] net: marvell: prestera: Add PCI interface support Vadym Kochan
2020-07-27 12:32 ` Jiri Pirko
2020-07-27 12:35 ` Vadym Kochan
2020-07-27 13:02 ` Jiri Pirko
2020-07-27 13:29 ` Andy Shevchenko
2020-07-27 14:11 ` Jiri Pirko
2020-07-27 15:33 ` Andy Shevchenko
2020-07-27 12:22 ` [net-next v4 3/6] net: marvell: prestera: Add basic devlink support Vadym Kochan
2020-07-27 13:07 ` Andy Shevchenko
2020-07-28 12:30 ` Vadym Kochan [this message]
2020-07-28 13:24 ` Andy Shevchenko
2020-07-27 12:22 ` [net-next v4 4/6] net: marvell: prestera: Add ethtool interface support Vadym Kochan
2020-07-27 13:17 ` Andy Shevchenko
2020-07-27 12:22 ` [net-next v4 5/6] net: marvell: prestera: Add Switchdev driver implementation Vadym Kochan
2020-07-27 12:22 ` [net-next v4 6/6] dt-bindings: marvell,prestera: Add description for device-tree bindings Vadym Kochan
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=20200728123006.GA10391@plvision.eu \
--to=vadym.kochan@plvision.eu \
--cc=andrew@lunn.ch \
--cc=andrii.savka@plvision.eu \
--cc=andy.shevchenko@gmail.com \
--cc=davem@davemloft.net \
--cc=idosch@mellanox.com \
--cc=jiri@mellanox.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mickeyr@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=oleksandr.mazur@plvision.eu \
--cc=serhiy.boiko@plvision.eu \
--cc=serhiy.pshyk@plvision.eu \
--cc=taras.chornyi@plvision.eu \
--cc=volodymyr.mytnyk@plvision.eu \
/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).