lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230405144959.t2vledwhwzyahyuk@pengutronix.de>
Date:   Wed, 5 Apr 2023 16:49:59 +0200
From:   Marco Felsch <m.felsch@...gutronix.de>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <linux@...linux.org.uk>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Broadcom internal kernel review list 
        <bcm-kernel-feedback-list@...adcom.com>,
        Richard Cochran <richardcochran@...il.com>,
        Radu Pirea <radu-nicolae.pirea@....nxp.com>,
        Shyam Sundar S K <Shyam-sundar.S-k@....com>,
        Yisen Zhuang <yisen.zhuang@...wei.com>,
        Salil Mehta <salil.mehta@...wei.com>,
        Jassi Brar <jaswinder.singh@...aro.org>,
        Ilias Apalodimas <ilias.apalodimas@...aro.org>,
        Iyappan Subramanian <iyappan@...amperecomputing.com>,
        Keyur Chudgar <keyur@...amperecomputing.com>,
        Quan Nguyen <quan@...amperecomputing.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <lenb@...nel.org>, Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
        devicetree@...r.kernel.org, kernel@...gutronix.de
Subject: Re: [PATCH 03/12] net: phy: add phy_device_set_miits helper

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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ