[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <06f5c065-2c6d-4cd2-9699-89f05443f137@lunn.ch>
Date: Wed, 28 Jun 2023 22:46:32 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Rahul Rameshbabu <rrameshbabu@...dia.com>, netdev@...r.kernel.org,
Richard Cochran <richardcochran@...il.com>,
Paolo Abeni <pabeni@...hat.com>, Saeed Mahameed <saeed@...nel.org>,
Gal Pressman <gal@...dia.com>,
"David S. Miller" <davem@...emloft.net>,
lkft-triage@...ts.linaro.org, LTP List <ltp@...ts.linux.it>,
Nathan Chancellor <nathan@...nel.org>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
Linux Kernel Functional Testing <lkft@...aro.org>
Subject: Re: [PATCH net v1] ptp: Make max_phase_adjustment sysfs device
attribute invisible when not supported
On Wed, Jun 28, 2023 at 01:38:50PM -0700, Jakub Kicinski wrote:
> On Wed, 28 Jun 2023 03:16:43 +0200 Andrew Lunn wrote:
> > > + } else if (attr == &dev_attr_max_phase_adjustment.attr) {
> > > + if (!info->adjphase || !info->getmaxphase)
> > > + mode = 0;
> >
> > Maybe it is time to turn this into a switch statement?
>
> I don't think we can switch on pointers in C.
https://elixir.bootlin.com/linux/latest/source/drivers/net/phy/sfp.c#L749
Works for temperature sensors, voltage sensors, current sensors, and
power sensors. Maybe hwmon is different to what is going on here, but
both a sysfs files.
> The patch is good as is, right?
Yes.
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Andrew
Powered by blists - more mailing lists