#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)))
+
#define DIRENT_INO(dirent) ((dirent) !=NULL ? je32_to_cpu((dirent)->ino) : 0)
#define DIRENT_PINO(dirent) ((dirent) !=NULL ? je32_to_cpu((dirent)->pino) : 0)
do {
while (n < e && je16_to_cpu(n->u.magic) != JFFS2_MAGIC_BITMASK)
- ((char *) n) += 4;
+ ADD_BYTES(n, 4);
if (n < e && je16_to_cpu(n->u.magic) == JFFS2_MAGIC_BITMASK) {
if (je16_to_cpu(n->u.nodetype) == JFFS2_NODETYPE_INODE &&
return (&(n->i));
}
- ((char *) n) += ((je32_to_cpu(n->u.totlen) + 3) & ~3);
+ ADD_BYTES(n, ((je32_to_cpu(n->u.totlen) + 3) & ~3));
} else
n = (union jffs2_node_union *) o; /* we're at the end, rewind to the beginning */
do {
while (n < e && je16_to_cpu(n->u.magic) != JFFS2_MAGIC_BITMASK)
- ((char *) n) += 4;
+ ADD_BYTES(n, 4);
if (n < e && je16_to_cpu(n->u.magic) == JFFS2_MAGIC_BITMASK) {
if (je16_to_cpu(n->u.nodetype) == JFFS2_NODETYPE_DIRENT &&
}
}
- ((char *) n) += ((je32_to_cpu(n->u.totlen) + 3) & ~3);
+ ADD_BYTES(n, ((je32_to_cpu(n->u.totlen) + 3) & ~3));
} else
n = (union jffs2_node_union *) o; /* we're at the end, rewind to the beginning */
do {
while (n < e && je16_to_cpu(n->u.magic) != JFFS2_MAGIC_BITMASK)
- ((char *) n) += 4;
+ ADD_BYTES(n, 4);
if (n < e && je16_to_cpu(n->u.magic) == JFFS2_MAGIC_BITMASK) {
if (je16_to_cpu(n->u.nodetype) == JFFS2_NODETYPE_DIRENT &&
}
}
- ((char *) n) += ((je32_to_cpu(n->u.totlen) + 3) & ~3);
+ ADD_BYTES(n, ((je32_to_cpu(n->u.totlen) + 3) & ~3));
} else
return dd;
} while (1);