Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6333428rwb; Mon, 5 Dec 2022 10:47:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Yv51XlUTIV09tnzwh99qW8gTw5DIbVMTZy1i7dunrsOiF8kyWDwGvl4Dy2IqHAjEHrUqm X-Received: by 2002:a17:907:1dd0:b0:7c0:9e28:e5eb with SMTP id og16-20020a1709071dd000b007c09e28e5ebmr20718505ejc.390.1670266034553; Mon, 05 Dec 2022 10:47:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670266034; cv=none; d=google.com; s=arc-20160816; b=oLM30VWgwnOY+lYXsfRzFn8bsCW22rYuyoRERa38Bm0jtq09Gs9tfxEUI8olQQLtn4 0wF4ZePC7XgByVfihqxmT1r0K0fZZm9gZOQBLrEra/Yo4OEtWttrm3WZa18kEbc37JTm GASA018dbkQ5kyy7njTMdI1sCkvkbIu/+tlTCCCl32VZ+fPqVC1roOXJL0CqG+Z2ahMa pg4SHk0HlfVPEzKKRayXswhFUSqlQW6pY/QrPjWqCE83kK86mQYCINhPT6qONGeJOYaC oPtaA5gP9eliOW1v8GYa5mDdVrbWiW2hMRF0FxSRIQz2VWJa7F7HIta4bHQd3AYHEDeQ tS4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+uOk4r1kIs18BqPaDqirsB9HgQ0g7FLtL1ZZXGSiEKU=; b=B234nOOlrS850BJqivKnVfiiqyUSQHqxIs+BKxx1E476+bKpYiTUSh3hwLDhWNJC0F aImIkAprAtTvxUMBsiMZpbHcB218mHSbJteQHVO+VSq7G2GbPnfBnR0EjSjk6zck9zeG MTnt3g/em3xHGy2nWEAqmhXkRcGiKB0BKJDf4ur3t/+Ryuhzww0krUnpyCdEEJ496v+7 uJ1KbOONF1yVe1XwqZ+ouylV6KHiJVJV+AyFEVvHJBhbLLSSx3VUrPz54tXvd/1AKsJ7 m0Fzw/d3sLDGzlNU/Y8sDQkBhbrpm6y3HjyyhKhY0e4082pmVgKO0HlIOA1x0vgQNOC/ /lUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="lqr+/KfZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m20-20020a056402511400b00462e628189asi175273edd.304.2022.12.05.10.46.53; Mon, 05 Dec 2022 10:47:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="lqr+/KfZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231319AbiLESF1 (ORCPT + 82 others); Mon, 5 Dec 2022 13:05:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231862AbiLESFQ (ORCPT ); Mon, 5 Dec 2022 13:05:16 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 746701F627; Mon, 5 Dec 2022 10:05:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+uOk4r1kIs18BqPaDqirsB9HgQ0g7FLtL1ZZXGSiEKU=; b=lqr+/KfZhLszcIftHEIUNAlYg1 QlcwhP1ucDSt1TIxecMDZGtTws9RndvoTXGnJCrfD9shwfJshEb/nPqe/+MWEhQOudaqctfdRvSEO qNB6eOlaG4d3hNpgquf8xAXzRxoIujTbRvLvrWuUEK5X7fVeIHfCoT5K6ceZscvgLzC0X8NLqUo1i 5w+TKMTx8U1sdfGlhp5cPSnzGHIhhyefvNEE5ViU1onStG/6JW0f6/wMfCs+xbbBm6MnQwbF7kAYg 7S04T/04Eku9qREnPuhKxqhj761io8WRWmI7Rxg2XQ3QZuQija2wN4JeYokp5yC/mz4it4TC03zdz FrTM+SQg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35586) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1p2Fq1-00072b-HS; Mon, 05 Dec 2022 18:05:09 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1p2Fpz-0007Qv-6K; Mon, 05 Dec 2022 18:05:07 +0000 Date: Mon, 5 Dec 2022 18:05:07 +0000 From: "Russell King (Oracle)" To: Piergiorgio Beruto Cc: Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Oleksij Rempel Subject: Re: [PATCH v3 net-next 1/4] net/ethtool: add netlink interface for the PLCA RS Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 05, 2022 at 06:17:37PM +0100, Piergiorgio Beruto wrote: > diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c > index e5b6cb1a77f9..99e3497b6aa1 100644 > --- a/drivers/net/phy/phy.c > +++ b/drivers/net/phy/phy.c > @@ -543,6 +543,40 @@ int phy_ethtool_get_stats(struct phy_device *phydev, > } > EXPORT_SYMBOL(phy_ethtool_get_stats); > > +/** > + * > + */ > +int phy_ethtool_get_plca_cfg(struct phy_device *dev, > + struct phy_plca_cfg *plca_cfg) > +{ > + // TODO > + return 0; > +} > +EXPORT_SYMBOL(phy_ethtool_get_plca_cfg); > + > +/** > + * > + */ > +int phy_ethtool_set_plca_cfg(struct phy_device *dev, > + struct netlink_ext_ack *extack, > + const struct phy_plca_cfg *plca_cfg) > +{ > + // TODO > + return 0; > +} > +EXPORT_SYMBOL(phy_ethtool_set_plca_cfg); > + > +/** > + * > + */ > +int phy_ethtool_get_plca_status(struct phy_device *dev, > + struct phy_plca_status *plca_st) > +{ > + // TODO > + return 0; > +} > +EXPORT_SYMBOL(phy_ethtool_get_plca_status); > + > /** > * phy_start_cable_test - Start a cable test > * > diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c > index 716870a4499c..f248010c403d 100644 > --- a/drivers/net/phy/phy_device.c > +++ b/drivers/net/phy/phy_device.c > @@ -3262,6 +3262,9 @@ static const struct ethtool_phy_ops phy_ethtool_phy_ops = { > .get_sset_count = phy_ethtool_get_sset_count, > .get_strings = phy_ethtool_get_strings, > .get_stats = phy_ethtool_get_stats, > + .get_plca_cfg = phy_ethtool_get_plca_cfg, > + .set_plca_cfg = phy_ethtool_set_plca_cfg, > + .get_plca_status = phy_ethtool_get_plca_status, > .start_cable_test = phy_start_cable_test, > .start_cable_test_tdr = phy_start_cable_test_tdr, > }; From what I can see, none of the above changes need to be part of patch 1 - nothing in the rest of the patch requires these members to be filled in, since you explicitly test to see whether they are before calling them. So, rather than introducing docbook stubs and stub functions that do nothing, marked with "TODO" comments, just merge these changes above with patch 3, where you actually populate these functions. Also, why do they need to be exported to modules? From what I can see, the only user of these functions is phy_device.c, which is part of the same module as phy.c where the functions live, meaning that they don't need to be exported. It's also surely wrong to introduce stubs that return success but do nothing. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!