Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp595068rwl; Wed, 5 Apr 2023 05:19:21 -0700 (PDT) X-Google-Smtp-Source: AKy350bFLDayYwqqvNC44YTGEU89vHvcXEI4kg5tL8gtFp/nr+cYzDs4sPhERumYVGcFlh3Cuvp7 X-Received: by 2002:a05:6402:3cd:b0:4fa:ecdc:e44b with SMTP id t13-20020a05640203cd00b004faecdce44bmr1719899edw.24.1680697161690; Wed, 05 Apr 2023 05:19:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680697161; cv=none; d=google.com; s=arc-20160816; b=kXNN7PizjHYiHVOi0frpzqhYjhmbgYVVju6C7i/aiKooaFkHu6kvkrTXPnS5yqfv3B Ryjtexxul2CxLBQSz96RRBF1LPaq+an4PZZwwJSVhT9qeh6J9anKZUCMOiL8FMPpvtRv td7tSklMyEM6rQtqignKgquaDOOsTUMsIZCesOBsjhtLOJHulvfTNIzlGs1AFT09kko0 z2m/Ss+CUpZSAcqe2q9/ORZgMlRibDdmvZoX/LkXDzXrgC93R2byhqQfETiRXRWNARzU NvoBRdVaKNEcbTH3wiSBG+68o2HNrkbfNPXCnB8ezAGzEI5TbAcZDRUg7mH8EkLdkG0E +k+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qWBuUdDNLTomMrWa17ue40qpTA5SPEfNQkTISsS/20Y=; b=0NyMWtaEhetB18uBBCh7Ek/kvcqSn2FUxS0Y6TQQ4qlB6z6p2qQihvNDYMYzGvnQyz x1JRCqNqB9EXq6EcYOcS0kJpHY9ja8666r/74QSvcmL5t2DOuGxCXk0Wpe9Vj2q23dJ6 rbY0F/BgyTMVORyuRXSP0/i196PNPUnCm5JPyMZdM9hQCAaEJuS1QUmzKtjJNAFr47/R lvhaHoviHig5ioF4ocYG1MSE68i+rpbLV1tdRF5XMVX8aThpg0STOsQqV5gOM3uyQnAr RAljT0cdO+OVpjP6Uz6jnE83OMwNvGgjvOjK/qaJr3+V33es7IU8cddBUIPQnxkgEMO/ X2ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=URiP68ON; 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=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w2-20020aa7d282000000b005024aa3e836si13355879edq.394.2023.04.05.05.18.57; Wed, 05 Apr 2023 05:19:21 -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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=URiP68ON; 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=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237701AbjDEMHL (ORCPT + 99 others); Wed, 5 Apr 2023 08:07:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230520AbjDEMHK (ORCPT ); Wed, 5 Apr 2023 08:07:10 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6F85423B; Wed, 5 Apr 2023 05:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=qWBuUdDNLTomMrWa17ue40qpTA5SPEfNQkTISsS/20Y=; b=URiP68ONioLF3PEBmrHrpCwU3N MkWdAfLyOLgHVH5SB0rg98qCkHgkTSjumXpkW4Q3Sb9Juv587zbcO10z9vGcNXDeqGK9ezMlgyXLd WjLCUCigqNKA/klnPdrYUNbJHVi4hNttRqKG0ZKr77RNMcmh1edSIhtHJgCeZ/iDfz1w=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pk1uZ-009W6d-3C; Wed, 05 Apr 2023 14:06:47 +0200 Date: Wed, 5 Apr 2023 14:06:47 +0200 From: Andrew Lunn To: Marco Felsch 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: 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: <20230405-net-next-topic-net-phy-reset-v1-3-7e5329f08002@pengutronix.de> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 > +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. > +EXPORT_SYMBOL(phy_device_set_miits); _GPL please. The code is a bit inconsistent, but new symbols should be EXPORT_SYMBOL_GPL. I do however like this patch, hiding away the internals of phydev. Andrew