Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp810314rwl; Wed, 5 Apr 2023 08:02:48 -0700 (PDT) X-Google-Smtp-Source: AKy350aEQE35/sfsxSX+x4U9X6bca7vaE6vO+97GiFQu2sospu1CtuBEhi5BIoFb5fYWxjE6CUMg X-Received: by 2002:aa7:d8cc:0:b0:501:cde8:c523 with SMTP id k12-20020aa7d8cc000000b00501cde8c523mr2375678eds.6.1680706968394; Wed, 05 Apr 2023 08:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680706968; cv=none; d=google.com; s=arc-20160816; b=vbEVqi4X2j4LI/+J4cO/RJ/a7y696QubSk9dRIHpRT1ug22mfh3Ud4L9NaCINxgyO3 wj7FFBQhNpJT1F7eHJTGxYQuAyLtjV6zvv5iWfHUaNxCZ/IaYtpgAdjCpzP2ZkT8jCL+ neZxl0CKhCj1LXbullfBRns0tFJT7JfFW6KD/gOTohfehH0yJWZz2N13J6gy6YMwBx2+ SuQXL3xQk9WWdLDpT/Gqa78KsYVhm6v6cANKuL8Lwvf0C+pTaEzI+lWSNAy5zOiO16t0 eMVZkYryeRw7WO2tTegdOImDEXIxFAw8yP+CWLoUxR83AaHb7I19zAIe343FqA701EaR tqNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=jG7JTqnPxyGbRQN9BzIRphOp3jrdal/hUPOTjdNFLIk=; b=u4VzaplQ7clO/4J4tZxhPfznbQm3tD6DvhSjhYuPeiSwTRJYU2Iq4AfOns/zyzkeXC dRV40T/4UYJ0HOhTd+Ch4LWfFP4cqmkjtHq6kwm1LR0/8gsUeQS8nn+HkMW5RO1W1ir5 yHM57YzsvM4dHvOzjtqojOhz2bm0hc9D3YvCZGghY9qoVMueSh9PMsTLmEcdZAZ1pmuB YeTrBGYQVAaAejoMxrNaVha+mLW6yFyox59BB4a6zNKxIiIwz00uCW21G/UZsV2kBtpE I27g+tJYFHudkWfWnHDsSZzR4uM4ToCagqsXdIkglIl25gq9Ew6kFORCbobDF/XLer5C JgvQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t26-20020aa7d4da000000b005024c86c50bsi956109edr.392.2023.04.05.08.02.19; Wed, 05 Apr 2023 08:02:48 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238519AbjDEOul (ORCPT + 99 others); Wed, 5 Apr 2023 10:50:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232507AbjDEOuj (ORCPT ); Wed, 5 Apr 2023 10:50:39 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D858A4C3D for ; Wed, 5 Apr 2023 07:50:38 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pk4SX-0001Cb-Ce; Wed, 05 Apr 2023 16:50:01 +0200 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1pk4SV-0007PB-33; Wed, 05 Apr 2023 16:49:59 +0200 Date: Wed, 5 Apr 2023 16:49:59 +0200 From: Marco Felsch To: Andrew Lunn Cc: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Fainelli , Broadcom internal kernel review list , Richard Cochran , Radu Pirea , Shyam Sundar S K , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , "Rafael J. Wysocki" , Len Brown , Rob Herring , Frank Rowand , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH 03/12] net: phy: add phy_device_set_miits helper Message-ID: <20230405144959.t2vledwhwzyahyuk@pengutronix.de> References: <20230405-net-next-topic-net-phy-reset-v1-0-7e5329f08002@pengutronix.de> <20230405-net-next-topic-net-phy-reset-v1-3-7e5329f08002@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 23-04-05, Andrew Lunn wrote: > > +void phy_device_set_miits(struct phy_device *phydev, > > + struct mii_timestamper *mii_ts) > > +{ > > + if (!phydev) > > + return; > > + > > + if (phydev->mii_ts) { > > + phydev_dbg(phydev, > > + "MII timestamper already set -> skip set\n"); > > + return; > > + } > > + > > + phydev->mii_ts = mii_ts; > > +} > > We tend to be less paranoid. Few, if any, other functions test that > phydev is not NULL. And the current code allows overwriting of an > existing stamper. If you think overwriting should not be allowed > return -EINVAL, and change all the callers to test for it. I can drop the 'if (!phydev)' check if you want. Return -EINVAL is possible too. > > +EXPORT_SYMBOL(phy_device_set_miits); > > _GPL please. The code is a bit inconsistent, but new symbols should be > EXPORT_SYMBOL_GPL. Sure! Don't know why I added it as EXPORT_SYMBOL in the first place. > I do however like this patch, hiding away the internals of phydev. Thanks for the fast response. Regards, Marco > > Andrew >