Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp433560ybt; Mon, 6 Jul 2020 12:58:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8VNO4rVda2+iGyMBVbSuMocEdaxKvEq/Qco2uL5CS7U9FPlpZnbzrszvh/lbrYS0bFSpy X-Received: by 2002:a17:906:434c:: with SMTP id z12mr38946036ejm.33.1594065534631; Mon, 06 Jul 2020 12:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594065534; cv=none; d=google.com; s=arc-20160816; b=ZI3itYMHL1M8861a4/tqFnEDPgLn21Ptq58rrr9PlJQnzlNvDaYVqlt4M2erFG/9u2 FMGtfgtJGWnOw3jtD+XPxKrdygfuewtLPY3cdiIej0J7dU2LjHEmJLpy6upV6Qarhkxu HbW2LyEubteCdr4qEPOKasjHSgu5bSGV5EIUIyUEwRzuidtUB4O2lfsryaIaVuv1OK3A 1DBdREE5I3Yaglwtg3AbekhDlwpq4BR7WmsnuwQhY0VTRnC6I++l+gzZmos8/k5RjqHM vKyT80RZwfWSEcE8aed47aB2SK3FBO7gQHiQspj3uCuMp35WmuSlSg5aQCwF0RW4CRvu F3Bw== 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; bh=tWze+sMhJLE8fAjhNx5c8VhXYY4lqyrb9K1iryLI9YQ=; b=IN7dawibFWaOstrnHvDLRfpfQev9elrt6z7vlhGEDHocPFOxYlQfxxRjrfgjSOYVz4 ecus1i9udCfgKjex6IR+0c0TXn8uk7G7ytclCXyqejNbwhOgf354u4j+ptiBGUl/Gj2i KULIo1KqwhvPpbZshkbnVz3RhEPA71fcp8jeqhBYqc/EUnrPM/pf1Ejd2JxmjcSvhyaV nruComFZ0E4ZfEOJRxGp80a+QhvQrq3/q7NGoGK+D+7vVb26mXuAndDlk2GxPyC8MXLE uDdis1bfWm5asDvp033BbmVyCXI3k0o2PiDWkCCE/2XNqsJS6L8cnYNrzyjZ/nIgccWr 8N5w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si14125283ejd.152.2020.07.06.12.58.31; Mon, 06 Jul 2020 12:58:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726816AbgGFT4L (ORCPT + 99 others); Mon, 6 Jul 2020 15:56:11 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:49804 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbgGFT4L (ORCPT ); Mon, 6 Jul 2020 15:56:11 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1jsXDf-003uPR-1e; Mon, 06 Jul 2020 21:56:03 +0200 Date: Mon, 6 Jul 2020 21:56:03 +0200 From: Andrew Lunn To: Jakub Kicinski Cc: Florian Fainelli , netdev@vger.kernel.org, Heiner Kallweit , Russell King , "David S. Miller" , Michal Kubecek , open list Subject: Re: [PATCH net-next v2 3/3] net: ethtool: Remove PHYLIB direct dependency Message-ID: <20200706195603.GA893522@lunn.ch> References: <20200706042758.168819-1-f.fainelli@gmail.com> <20200706042758.168819-4-f.fainelli@gmail.com> <20200706114000.223e27eb@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200706114000.223e27eb@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 06, 2020 at 11:40:00AM -0700, Jakub Kicinski wrote: > On Sun, 5 Jul 2020 21:27:58 -0700 Florian Fainelli wrote: > > + ops = ethtool_phy_ops; > > + if (!ops || !ops->start_cable_test) { > > nit: don't think member-by-member checking is necessary. We don't > expect there to be any alternative versions of the ops, right? I would not like to see anything else registering an ops. So i think taking an Opps would be a good indication somebody is doing something wrong and needs fixing. > We could even risk a direct call: > > #if IS_REACHABLE(CONFIG_PHYLIB) > static inline int do_x() > { > return __do_x(); > } > #else > static inline int do_x() > { > if (!ops) > return -EOPNOTSUPP; > return ops->do_x(); > } > #endif > > But that's perhaps doing too much... I would say it is too far. Two ways of doing the same thing requires twice as much testing. And these are not hot paths where we want to eliminate as many instructions and trampolines as possible. Andrew