aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2011-09-19 14:25:24 +0300
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-21 09:35:04 +0300
commit36d8de81049c9c908740b690c664b5bd3703ccd6 (patch)
treecb82bc023563b0c95697e86e40dec5fd83d7f360
parent168c61e4bcda8bf255e95414bd153482787b6898 (diff)
jffs2reader: use major() and minor() helpers
There are major() and minor() helpers in the standard library. We can use them. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
-rw-r--r--jffs2reader.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/jffs2reader.c b/jffs2reader.c
index 501b6bf..5231ff0 100644
--- a/jffs2reader.c
+++ b/jffs2reader.c
@@ -81,13 +81,6 @@ BUGS:
#define SCRATCH_SIZE (5*1024*1024)
-#ifndef MAJOR
-/* FIXME: I am using illicit insider knowledge of
- * kernel major/minor representation... */
-#define MAJOR(dev) (((dev)>>8)&0xff)
-#define MINOR(dev) ((dev)&0xff)
-#endif
-
/* macro to avoid "lvalue required as left operand of assignment" error */
#define ADD_BYTES(p, n) ((p) = (typeof(p))((char *)(p) + (n)))
@@ -362,7 +355,7 @@ void printdir(char *o, size_t size, struct dir *d, const char *path, int recurse
dev_t rdev;
size_t devsize;
putblock((char*)&rdev, sizeof(rdev), &devsize, ri);
- printf("%4d, %3d ", (int)MAJOR(rdev), (int)MINOR(rdev));
+ printf("%4d, %3d ", major(rdev), minor(rdev));
} else {
printf("%9ld ", (long)je32_to_cpu(ri->dsize));
}