diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-12-09 16:31:41 +0200 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-12-09 16:31:41 +0200 |
commit | 34e28bf35f7cc7758f87e6a2b82adf6ca186afdb (patch) | |
tree | 3e7cd7c868cbdc32c73b613d5465e8f298c6dc25 /ubi-utils | |
parent | 2426f4b7219c77b3d33b40c01f6d97d0ca0adc5f (diff) |
ubiformat: check that min IO size is power of 2
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils')
-rw-r--r-- | ubi-utils/src/ubiformat.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ubi-utils/src/ubiformat.c b/ubi-utils/src/ubiformat.c index 681ea30..c87dfd0 100644 --- a/ubi-utils/src/ubiformat.c +++ b/ubi-utils/src/ubiformat.c @@ -721,6 +721,11 @@ int main(int argc, char * const argv[]) goto out_close_mtd; } + if (!is_power_of_2(mtd.min_io_size)) { + errmsg("min. I/O size is %d, but should be power of 2"); + goto out_close; + } + if (!mtd_info.sysfs_supported) { /* * Linux kernels older than 2.6.30 did not support sysfs |