summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/ubi.h
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2016-06-14 10:12:13 +0200
committerRichard Weinberger <richard@nod.at>2016-07-29 23:32:39 +0200
commit243a4f8126fcf7facb04b324dbb7c85d10b11ce9 (patch)
tree83fd8f073260618a6a46ceb8e94ee7262bbcf430 /drivers/mtd/ubi/ubi.h
parentubi: Fix scan_fast() comment (diff)
downloadlinux-243a4f8126fcf7facb04b324dbb7c85d10b11ce9.tar.xz
linux-243a4f8126fcf7facb04b324dbb7c85d10b11ce9.zip
ubi: Introduce vol_ignored()
This makes the logic more easy to follow. Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd/ubi/ubi.h')
-rw-r--r--drivers/mtd/ubi/ubi.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 61d4e99755a4..91075b603d82 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -1105,4 +1105,19 @@ static inline int idx2vol_id(const struct ubi_device *ubi, int idx)
return idx;
}
+/**
+ * ubi_is_fm_vol - check whether a volume ID is a Fastmap volume.
+ * @vol_id: volume ID
+ */
+static inline bool ubi_is_fm_vol(int vol_id)
+{
+ switch (vol_id) {
+ case UBI_FM_SB_VOLUME_ID:
+ case UBI_FM_DATA_VOLUME_ID:
+ return true;
+ }
+
+ return false;
+}
+
#endif /* !__UBI_UBI_H__ */