Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1026827ybg; Mon, 27 Jul 2020 06:09:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXeyn46TPtp8QTyxPu9ZEh3uZzZoGDzAwZS1NeTuEGUc6LycbkKUl18Py/KYCQlvYc22/+ X-Received: by 2002:a17:907:7251:: with SMTP id ds17mr6764436ejc.289.1595855356955; Mon, 27 Jul 2020 06:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595855356; cv=none; d=google.com; s=arc-20160816; b=BUSfvrHP/U2/Yt4qat4REfvc2VIqMaDmtNHFa8jF1K8pEU2xqXIkP63tI05ayInia0 1CXtXsQCADjbtqpiOgU/B80WhoIrLdI5znZ3iL348Y/YIxOpgutvtnkIwOZioQM+rDsn 9KNJd6clfDW6aP0PKrPlClxHqqtg96JgSzfOAKMfAM+AY6dETKn2a78uOe5hasluyFm6 16xQExYV23zGtVTRH7EfrQNOeYoW227EcJ/U+QPDmZnqRXpsd4DHIlBvOfgy04X5CwoF t7RQjiwz4SOaTOC/OSvulujPo86X8IS/F3b6Mod+NoJZD4vDFSPl/Uf42SMO7QcI9iGr 3J+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=aU4uOkyeKSlCP6DAw6Cy7Ktbov/Gh5qKQZ6czddo9eY=; b=BIULywoqsvpzr/ObpdDG/G8GwLYMvjLlZO9iY5MECvwCzhy8hyeZTGjVJYnljhfVtX IuCh2QtocQG+cINVbJDCmfnrPUtmvkHDcDLhq7r6IgvMpWV5o065ZbexcoYKPhYOUwow DJokQiQHdm1ZvCC8BDM4Ev30psoCj6R8A10LGBhqLp3eUwbebYVJXngSHuvk+UAzKMSk HOUKyoMxc2ugdcJc0+sjzzGB4znuchgUpNU3GHP0Dk5VwK69czMHXBrUhUUc+Kji3ePS QnRuLT+zjjwfY12F70/ktdjY8hPAnXgJMJbV/6WKwluDwvqd5PhNDXfdg+sNvSMa1Mex 7D7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LMvbgGA0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l15si5716671ejq.119.2020.07.27.06.08.54; Mon, 27 Jul 2020 06:09:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LMvbgGA0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728652AbgG0NHW (ORCPT + 99 others); Mon, 27 Jul 2020 09:07:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728393AbgG0NHW (ORCPT ); Mon, 27 Jul 2020 09:07:22 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 554C1C061794; Mon, 27 Jul 2020 06:07:22 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id w2so9461115pgg.10; Mon, 27 Jul 2020 06:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aU4uOkyeKSlCP6DAw6Cy7Ktbov/Gh5qKQZ6czddo9eY=; b=LMvbgGA04HznqjLaf5szOXCLSh9x11dnwmIwyhStp3Yd6GdkUIoccAW/Isj24QFJWW wdI6Czp8coHdtka/GILmJP2zDVqFW31MkuUJjMDot+6afXCbcCATnr/g8bcFqTBSX97Z VmXwKBzn7yrfC4307jov37Vl263FjWd1ACqRLatKLfxh+znxF+VyON54aaFRAhFZU0Gu WWinM7ylHXnAKlfIOoxvjSmbCCiIY7wFBZ9Ap14yWC5mvPx8tcw+iW+KpDwnhNK1mIIQ WXqG3n8q9+BoLDsALdNMXgiqXpNUbIKGlUWQWZw/or+yikJ3plwPIPd7dNyBGhOkhYq2 BSFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aU4uOkyeKSlCP6DAw6Cy7Ktbov/Gh5qKQZ6czddo9eY=; b=LFnEvp7NDRDm9wOKBymHjqZUKGIARzIuFWKVwIh4EW59BZFFcd5VAPJRntDBVMcArZ mng9+8UxT6XRmsU36biW73GcgJIdCftqQqAp79dd2oF6aNyT52uGX76mmwrsm07aoo5f GuCmv1z5FtBOFg4YLSwyzFcdaLkhI0Y3dwHc/TRvWDwKnq0L0Dd4fTNhHmvpswLvMnCD RWPancTfrTGT1bdu2G9qNg86pC6xxmoU0KOzkVVNJ//CBEvO+aJGKzzQISpL5FmXndFn hoLQMMt4H1+e9pGyL1SrpMUq0k76a/dV3GP8x5+wnF5XXAhrU3moZvCadqZ2oBS4yGrS vNWA== X-Gm-Message-State: AOAM531SF6ZnPlRqpDpa+of1vpSP8T2ELXhSUx9QtfAfxgQbiKMJeNj4 TuGuDuVftGWpsfRH0NgTziooWZ+uL928U5Q7pC8= X-Received: by 2002:a63:a05f:: with SMTP id u31mr19297932pgn.4.1595855241880; Mon, 27 Jul 2020 06:07:21 -0700 (PDT) MIME-Version: 1.0 References: <20200727122242.32337-1-vadym.kochan@plvision.eu> <20200727122242.32337-4-vadym.kochan@plvision.eu> In-Reply-To: <20200727122242.32337-4-vadym.kochan@plvision.eu> From: Andy Shevchenko Date: Mon, 27 Jul 2020 16:07:07 +0300 Message-ID: Subject: Re: [net-next v4 3/6] net: marvell: prestera: Add basic devlink support To: Vadym Kochan Cc: "David S. Miller" , Jakub Kicinski , Jiri Pirko , Ido Schimmel , Andrew Lunn , Oleksandr Mazur , Serhiy Boiko , Serhiy Pshyk , Volodymyr Mytnyk , Taras Chornyi , Andrii Savka , netdev , Linux Kernel Mailing List , Mickey Rachamim Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 27, 2020 at 3:23 PM Vadym Kochan 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