The patch titled log2.h: Define order_base_2() macro for convenience. has been added to the -mm tree. Its filename is log2h-define-order_base_2-macro-for-convenience.patch *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: log2.h: Define order_base_2() macro for convenience. From: "Robert P. J. Day" <rpjday@xxxxxxxxxxxxxx> Given a number of places in the tree that need to calculate this value explicitly, might as well just create a macro for it. (akpm: must be implemented as a macro for callee typeof() usage) Signed-off-by: Robert P. J. Day <rpjday@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/log2.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff -puN include/linux/log2.h~log2h-define-order_base_2-macro-for-convenience include/linux/log2.h --- a/include/linux/log2.h~log2h-define-order_base_2-macro-for-convenience +++ a/include/linux/log2.h @@ -190,4 +190,20 @@ unsigned long __rounddown_pow_of_two(uns __rounddown_pow_of_two(n) \ ) +/** + * order_base_2 - calculate the (rounded up) base 2 order of the argument + * @n: parameter + * + * The first few values calculated by this routine: + * ob2(0) = 0 + * ob2(1) = 0 + * ob2(2) = 1 + * ob2(3) = 2 + * ob2(4) = 2 + * ob2(5) = 3 + * ... and so on. + */ + +#define order_base_2(n) ilog2(roundup_pow_of_two(n)) + #endif /* _LINUX_LOG2_H */ _ Patches currently in -mm which might be from rpjday@xxxxxxxxxxxxxx are arm-remove-reference-to-non-existent-mtd_obsolete_chips.patch hwmon-replace-power-of-two-test-in-drivers-hwmon-adt7470c.patch git-mips.patch pcmcia-net-use-roundup_pow_of_two-macro-instead-of-grotesque-loop.patch blackfin-typo-config_rtc_bfin_module.patch git-sparc64.patch frv-move-dma-macros-to-scatterlisth-for-consistency.patch m68knommu-remove-vestiges-of-non-existent-disktel.patch uml-delete-some-unused-headers.patch rd-use-is_power_of_2-in-drivers-block-rdc.patch log2h-define-order_base_2-macro-for-convenience.patch rtc-s3c-use-is_power_of_2-macro-for-simplicity.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html