Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1011894ybt; Tue, 7 Jul 2020 05:55:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCo4OIHjzG2S9PDZBzvfHn+HYNoy6Rr4EpbfcqWh78uB5tNTBUEAuZ3MxPabvg5SiLDgne X-Received: by 2002:a50:fc97:: with SMTP id f23mr51449524edq.255.1594126546437; Tue, 07 Jul 2020 05:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594126546; cv=none; d=google.com; s=arc-20160816; b=wQ8vujHcxhLhE2AqXcNvuNjrFXFJOm6WofbFVHYdYl90JgCBABLvbWoNMf+CdMtV+y bBsyaNxOTNGXGoEhwrwwiI2PS621OBsNe2RtbrcAVT66y5NvqvZxduWTxOgH0P8Gt9S/ a7QKPG8XsuLIxro4xNwlLy9WHTBjR35XGF1ArC7Z+fvM2oNvABFss2jUX1LGIIsKUPyt Vr+qi2InIdVSf4da8CpALo5IsJZUPArxadWprhSEID9WNlJ1IZwyEEu2nds/CrnpHBNo pRSvci6ZmFUcpdQCRGwmWVURsb/EoaK999QAf4TpVgsBpZoeC4sWEypvWVUHKrJRfcq3 UbKQ== 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=saZPk//jftfzVLgu7R4+VGu4QQSTr/UhvGZPc4ZOuhE=; b=0paZA9Exn2Pf+U934ZgTn04fyRvOEr2lLtnBFWGeNvC5EjbuJRod9Xx2nS0OUsQdWV SfV4rMh4bUv4SiLoDsQSPDgryb63762+ZCbPSZFIYA9ys0hhc/3niBEIwOWdvsJ6akh4 lBam4EJHDrzRtEVJ+vCMTAZXeTO9egooJ7P6iOL1N5c8weSaliuZG6YOLrNHlgK9yjmx YT4raxz/k5uAqxGvzSv+D6V3Agq2xaY4mQvGTVdQDPjI297FiRhB4k0SY8HjYtaLMEkF T+/JMo6IYgHHvnmOlvELpBjYxgi6L+dxpSif7LpNEPAUs4CFfCDCFPzI5bXCUBTHWG1i lr4w== 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 t1si15054829ejd.639.2020.07.07.05.55.23; Tue, 07 Jul 2020 05:55:46 -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 S1728053AbgGGMwz (ORCPT + 99 others); Tue, 7 Jul 2020 08:52:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:59806 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbgGGMwz (ORCPT ); Tue, 7 Jul 2020 08:52:55 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6CA2FAE68; Tue, 7 Jul 2020 12:52:54 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id 9E16460567; Tue, 7 Jul 2020 14:52:53 +0200 (CEST) Date: Tue, 7 Jul 2020 14:52:53 +0200 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Andrew Lunn , Jakub Kicinski , Florian Fainelli , Heiner Kallweit , Russell King , "David S. Miller" , open list Subject: Re: [PATCH net-next v2 3/3] net: ethtool: Remove PHYLIB direct dependency Message-ID: <20200707125253.dauwsket4eyitxkr@lion.mk-sys.cz> References: <20200706042758.168819-1-f.fainelli@gmail.com> <20200706042758.168819-4-f.fainelli@gmail.com> <20200706114000.223e27eb@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20200706195603.GA893522@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200706195603.GA893522@lunn.ch> 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 09:56:03PM +0200, Andrew Lunn wrote: > 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. Agreed, it seems a bit over the top. Michal