Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7753f1692f53d82b4cc08084462b0fd2803c1f04
Commit:     7753f1692f53d82b4cc08084462b0fd2803c1f04
Parent:     d7f0c4dc31f1297a613f1e61a7d682dc9a5e859a
Author:     Vignesh Babu <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 12 10:31:05 2007 +0530
Committer:  Artem Bityutskiy <[EMAIL PROTECTED]>
CommitDate: Wed Jul 18 16:55:26 2007 +0300

    UBI: use is_power_of_2()
    
    Replacing (n & (n-1)) in the context of power of 2 checks
    with is_power_of_2
    
    Signed-off-by: Vignesh Babu <[EMAIL PROTECTED]>
    Signed-off-by: Artem Bityutskiy <[EMAIL PROTECTED]>
---
 drivers/mtd/ubi/build.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 08ca214..eb8b55d 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -33,6 +33,7 @@
 #include <linux/moduleparam.h>
 #include <linux/stringify.h>
 #include <linux/stat.h>
+#include <linux/log2.h>
 #include "ubi.h"
 
 /* Maximum length of the 'mtd=' parameter */
@@ -422,8 +423,7 @@ static int io_init(struct ubi_device *ubi)
        ubi->hdrs_min_io_size = ubi->mtd->writesize >> ubi->mtd->subpage_sft;
 
        /* Make sure minimal I/O unit is power of 2 */
-       if (ubi->min_io_size == 0 ||
-           (ubi->min_io_size & (ubi->min_io_size - 1))) {
+       if (!is_power_of_2(ubi->min_io_size)) {
                ubi_err("bad min. I/O unit");
                return -EINVAL;
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to