Re: [PATCH RFC net-next v3 26/27] net: pse-pd: tps23881: Add support for static port priority feature

From: Kory Maincent
Date: Tue Dec 03 2024 - 05:45:56 EST


Hello Simon,

On Tue, 3 Dec 2024 10:29:13 +0000
Simon Horman <horms@xxxxxxxxxx> wrote:
>
> > +static int tps23881_irq_event_detection(struct tps23881_priv *priv,
> > + u16 reg_val,
> > + unsigned long *notifs,
> > + unsigned long *notifs_mask)
> > +{
> > + enum ethtool_pse_events event;
> > + int reg, ret, i, val;
> > + u8 chans;
> > +
> > + chans = tps23881_it_export_chans_helper(reg_val, 0);
> > + for_each_set_bit(i, (unsigned long *)&chans, TPS23881_MAX_CHANS) {
> >
>
> Hi Kory,
>
> The storage size of chans is only 1 byte, but here we are pretending that
> it has more space. Which seems to be a bit of a stretch. Perhaps it would
> be better to simply use unsigned long as the type of chans here and in
> tps23881_irq_event_classification().

Yes indeed. Thanks for the report.

Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com