On Mon, Apr 30, 2018 at 08:28:26AM +1000, NeilBrown wrote:
> On Sun, Apr 29 2018, Christian Lütke-Stetzkamp wrote:
> 
> > The function uffs that is implemented by this driver returns the same
> > values as the kernel function ffs. So the uffs function is removed and
> > the calls to it are replaced with calls to ffs.
> 
> This difference is that uffs receives and returns an "unsigned int".
> Maybe not a significant difference, but worth mentioning that you
> noticed it and reasoned that it wasn't significant.
>
Yes the type of the uffs function is unsigned int but I tested it for
all values, that the number returned is the same (in binary form). So
I don't think that it is significant.

> > @@ -1004,13 +975,13 @@ static inline void sdr_clr_bits(void __iomem *reg, 
> > u32 bs)
> >  do {                                                               \
> >     volatile unsigned int tv = sdr_read32(reg);                     \
> >     tv &= ~(field);                                                 \
> > -   tv |= ((val) << (uffs((unsigned int)field) - 1));               \
> > +   tv |= ((val) << (ffs((unsigned int)field) - 1));                \
> 
> Given that ffs() takes an "int", it is odd to cast "field" to an
> unsigned int to pass it.
> "field" is always a constant int, so no cast is needed.

That's correct, but I took it that way, because that is how the mtk-sd
driver does it. This makes the similarities more significant, but if
you like I'll change it.

Regards,
Christian
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to