aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/build.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/build.c')
-rw-r--r--drivers/mtd/ubi/build.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 08ca214abb95..eb8b55dcc3bb 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -33,6 +33,7 @@
33#include <linux/moduleparam.h> 33#include <linux/moduleparam.h>
34#include <linux/stringify.h> 34#include <linux/stringify.h>
35#include <linux/stat.h> 35#include <linux/stat.h>
36#include <linux/log2.h>
36#include "ubi.h" 37#include "ubi.h"
37 38
38/* Maximum length of the 'mtd=' parameter */ 39/* Maximum length of the 'mtd=' parameter */
@@ -422,8 +423,7 @@ static int io_init(struct ubi_device *ubi)
422 ubi->hdrs_min_io_size = ubi->mtd->writesize >> ubi->mtd->subpage_sft; 423 ubi->hdrs_min_io_size = ubi->mtd->writesize >> ubi->mtd->subpage_sft;
423 424
424 /* Make sure minimal I/O unit is power of 2 */ 425 /* Make sure minimal I/O unit is power of 2 */
425 if (ubi->min_io_size == 0 || 426 if (!is_power_of_2(ubi->min_io_size)) {
426 (ubi->min_io_size & (ubi->min_io_size - 1))) {
427 ubi_err("bad min. I/O unit"); 427 ubi_err("bad min. I/O unit");
428 return -EINVAL; 428 return -EINVAL;
429 } 429 }