From 1d36f1d42ac6614ffe276b873c14cd5dd197aa72 Mon Sep 17 00:00:00 2001 From: David Howells Date: Mon, 20 Feb 2012 22:39:18 +0000 Subject: [PATCH] --- yaml --- r: 292703 b: refs/heads/master c: e0891a9816316b5e05fd5b0453ffe9fd6a56f489 h: refs/heads/master i: 292701: 732915976a17446c0cc47d3a54bf3acde7191d21 292699: 5db6115ee403a88c6c6d0beffd0f0bf25c5f7f33 292695: 8c3ee4a7c3d8daaf40a4e30bc1073c95729d8158 292687: d51b3015491e748b5eaae89ebbd3e4b458f06d68 292671: 383ae9b7d6d12942b4f14554a56e194b87b540f6 v: v3 --- [refs] | 2 +- trunk/include/asm-generic/getorder.h | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 858dffb709ec..ee4bd2fee201 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7931d493051ea9b09e4fddee2dc40b2eb88d62b9 +refs/heads/master: e0891a9816316b5e05fd5b0453ffe9fd6a56f489 diff --git a/trunk/include/asm-generic/getorder.h b/trunk/include/asm-generic/getorder.h index 67e7245dc9b3..76e9687a3c86 100644 --- a/trunk/include/asm-generic/getorder.h +++ b/trunk/include/asm-generic/getorder.h @@ -5,7 +5,28 @@ #include -/* Pure 2^n version of get_order */ +/** + * get_order - Determine the allocation order of a memory size + * @size: The size for which to get the order + * + * Determine the allocation order of a particular sized block of memory. This + * is on a logarithmic scale, where: + * + * 0 -> 2^0 * PAGE_SIZE and below + * 1 -> 2^1 * PAGE_SIZE to 2^0 * PAGE_SIZE + 1 + * 2 -> 2^2 * PAGE_SIZE to 2^1 * PAGE_SIZE + 1 + * 3 -> 2^3 * PAGE_SIZE to 2^2 * PAGE_SIZE + 1 + * 4 -> 2^4 * PAGE_SIZE to 2^3 * PAGE_SIZE + 1 + * ... + * + * The order returned is used to find the smallest allocation granule required + * to hold an object of the specified size. + * + * The result is undefined if the size is 0. + * + * This function may be used to initialise variables with compile time + * evaluations of constants. + */ static inline __attribute_const__ int get_order(unsigned long size) { int order;