[PATCH net-next 1/3] ptp: add debugfs interfaces to loop back the periodic output signal

Wei Fang wei.fang at nxp.com
Fri Sep 5 12:25:50 AEST 2025


> 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.



More information about the Linuxppc-dev mailing list