[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<AM9PR04MB850521C7E01BF30E5BDEB2E88803A@AM9PR04MB8505.eurprd04.prod.outlook.com>
Date: Fri, 5 Sep 2025 02:25:50 +0000
From: Wei Fang <wei.fang@....com>
To: Vladimir Oltean <vladimir.oltean@....com>
CC: "richardcochran@...il.com" <richardcochran@...il.com>,
"andrew+netdev@...n.ch" <andrew+netdev@...n.ch>, "davem@...emloft.net"
<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
Clark Wang <xiaoning.wang@....com>, Frank Li <frank.li@....com>, "Y.B. Lu"
<yangbo.lu@....com>, "christophe.leroy@...roup.eu"
<christophe.leroy@...roup.eu>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "linuxppc-dev@...ts.ozlabs.org"
<linuxppc-dev@...ts.ozlabs.org>, "linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "imx@...ts.linux.dev"
<imx@...ts.linux.dev>
Subject: RE: [PATCH net-next 1/3] ptp: add debugfs interfaces to loop back the
periodic output signal
> On Wed, Sep 03, 2025 at 04:37:47PM +0800, Wei Fang wrote:
> > + buf[len] = '\0';
> > + cnt = sscanf(buf, "%u %d", &index, &enable);
> > + if (cnt != 2)
> > + return -EINVAL;
> > +
> > + if (index >= ops->n_per_lp)
> > + return -EINVAL;
> > +
> > + err = ops->perout_loopback(ops, index, enable ? 1 : 0);
>
> Why not just reject other 'enable' values than 1 or 0? You make it
> impossible for other values like '2' to be used in the future, if they
> are currently treated the same as '1'.
>
> Also, signed 'enable' doesn't make much sense.
Okay, I will add strict check to the enable values.
Powered by blists - more mailing lists