Re: [PATCH RFC net-next v2 03/18] net: pse-pd: tps23881: Use helpers to calculate bit offset for a channel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 31 Oct 2024 22:11:18 +0100
Andrew Lunn <andrew@xxxxxxx> wrote:

> > +	val = tps23881_set_val(ret, chan, 0, BIT(chan % 4), BIT(chan % 4));
> > +		val = tps23881_set_val(val, chan, 0, BIT(chan % 4),
> > +				       BIT(chan % 4));
> > +	val = tps23881_set_val(ret, chan, 4, BIT(chan % 4), BIT(chan % 4));
> > +		val = tps23881_set_val(val, chan, 4, BIT(chan % 4),
> > +				       BIT(chan % 4));
> > +	val = tps23881_calc_val(ret, chan, 0, BIT(chan % 4));
> > +		val = tps23881_calc_val(ret, chan, 0, BIT(chan % 4));
> > +	val = tps23881_calc_val(ret, chan, 0, BIT(chan % 4));
> > +	val = tps23881_calc_val(ret, chan, 4, BIT(chan % 4));
> > +		val = tps23881_calc_val(ret, chan, 0, BIT(chan % 4));
> > +		val = tps23881_calc_val(ret, chan, 4, BIT(chan % 4));  
> 
> It looks like all the callers of this helper pass BIT(chan % 4) as the
> last parameter. Maybe move that into the helper as well?

There is different cases in the patch 4 of the series.

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





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux