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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241217175450.GA716460@debian>
Date: Tue, 17 Dec 2024 18:54:50 +0100
From: Dimitri Fedrau <dima.fedrau@...il.com>
To: Simon Horman <horms@...nel.org>
Cc: Andrew Lunn <andrew@...n.ch>, 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>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: phy: dp83822: Add support for PHY LEDs on
 DP83822

Am Tue, Dec 17, 2024 at 04:32:08PM +0000 schrieb Simon Horman:
> On Tue, Dec 17, 2024 at 10:16:03AM +0100, Dimitri Fedrau wrote:
> > The DP83822 supports up to three configurable Light Emitting Diode (LED)
> > pins: LED_0, LED_1 (GPIO1), COL (GPIO2) and RX_D3 (GPIO3). Several
> > functions can be multiplexed onto the LEDs for different modes of
> > operation. LED_0 and COL (GPIO2) use the MLED function. MLED can be routed
> > to only one of these two pins at a time. Add minimal LED controller driver
> > supporting the most common uses with the 'netdev' trigger.
> > 
> > Signed-off-by: Dimitri Fedrau <dima.fedrau@...il.com>
> > ---
> >  drivers/net/phy/dp83822.c | 271 +++++++++++++++++++++++++++++++++++++++++++++-
> >  1 file changed, 269 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c
> 
> ...
> 
> > +static int dp83822_led_hw_control_set(struct phy_device *phydev, u8 index,
> > +				      unsigned long rules)
> > +{
> > +	int mode;
> > +
> > +	mode = dp83822_led_mode(index, rules);
> > +	if (mode < 0)
> > +		return mode;
> > +
> > +	if (index == DP83822_LED_INDEX_LED_0 || index == DP83822_LED_INDEX_COL_GPIO2)
> > +		return phy_modify_mmd(phydev, MDIO_MMD_VEND2,
> > +				      MII_DP83822_MLEDCR, DP83822_MLEDCR_CFG,
> > +				      FIELD_PREP(DP83822_MLEDCR_CFG, mode));
> 
> ...
> 
> > +}
> > +
> > +static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index,
> > +				      unsigned long *rules)
> > +{
> > +	int val;
> > +
> > +	if (index == DP83822_LED_INDEX_LED_0 || DP83822_LED_INDEX_COL_GPIO2) {
> 
> Hi Dimitri,
> 
> As per the condition near the top of dp83822_led_hw_control_set(), should
> this be:
> 
> 	if (index == DP83822_LED_INDEX_LED_0 ||
> 	    index == DP83822_LED_INDEX_COL_GPIO2) {
> 
> Flagged by W=1 + -Wno-error build with clang-19.
> 
>  drivers/net/phy/dp83822.c:1029:39: note: use '|' for a bitwise operation
>   1029 |         if (index == DP83822_LED_INDEX_LED_0 || DP83822_LED_INDEX_COL_GPIO2) {
>        |                                              ^~
>        |
> 
> ...
Thanks, will fix it.

Best regards,
Dimitri

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ