Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib/math/int_log: Use ARRAY_SIZE(logtable) where makes sense

Use ARRAY_SIZE(logtable) where makes sense.

Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Link: https://lore.kernel.org/r/20230619172019.21457-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230703135211.87416-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Andy Shevchenko and committed by
Mark Brown
08f6a14b f97fa3dc

+2 -2
+2 -2
lib/math/int_log.c
··· 91 91 * so we would use the entry 0x18 92 92 */ 93 93 significand = value << (31 - msb); 94 - logentry = (significand >> 23) & 0xff; 94 + logentry = (significand >> 23) % ARRAY_SIZE(logtable); 95 95 96 96 /** 97 97 * last step we do is interpolation because of the ··· 109 109 * logtable_next is 256 110 110 */ 111 111 interpolation = ((significand & 0x7fffff) * 112 - ((logtable[(logentry + 1) & 0xff] - 112 + ((logtable[(logentry + 1) % ARRAY_SIZE(logtable)] - 113 113 logtable[logentry]) & 0xffff)) >> 15; 114 114 115 115 /* now we return the result */