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. > @@ -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. Thanks, NeilBrown > sdr_write32(reg, tv); \ > } while (0) > #define sdr_get_field(reg, field, val) \ > do { \ > volatile unsigned int tv = sdr_read32(reg); \ > - val = ((tv & (field)) >> (uffs((unsigned int)field) - 1)); \ > + val = ((tv & (field)) >> (ffs((unsigned int)field) - 1)); \ > } while (0) > > #endif > -- > 2.16.1
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel