[PATCH 03/34] jffs2: Add casts and constant designators to address warnings on 16-bit targets

Joel Sherrill joel.sherrill at oarcorp.com
Mon Oct 20 20:34:05 UTC 2014


---
 cpukit/libfs/src/jffs2/include/linux/kernel.h | 2 +-
 cpukit/libfs/src/jffs2/src/nodelist.h         | 2 +-
 cpukit/libfs/src/jffs2/src/os-rtems.h         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpukit/libfs/src/jffs2/include/linux/kernel.h b/cpukit/libfs/src/jffs2/include/linux/kernel.h
index 3dc0ba1..4aa7702 100644
--- a/cpukit/libfs/src/jffs2/include/linux/kernel.h
+++ b/cpukit/libfs/src/jffs2/include/linux/kernel.h
@@ -9,7 +9,7 @@
 
 #define jiffies ((unsigned long)rtems_clock_get_ticks_since_boot())
 
-#define ERR_PTR(err) ((void*)(err))
+#define ERR_PTR(err) ((void*)((intptr_t)(err)))
 #define PTR_ERR(err) ((unsigned long)(err))
 #define IS_ERR(err) ((unsigned long)err > (unsigned long)-1000L)
 static inline void *ERR_CAST(const void *ptr)
diff --git a/cpukit/libfs/src/jffs2/src/nodelist.h b/cpukit/libfs/src/jffs2/src/nodelist.h
index 1e09f4b..001ac31 100644
--- a/cpukit/libfs/src/jffs2/src/nodelist.h
+++ b/cpukit/libfs/src/jffs2/src/nodelist.h
@@ -291,7 +291,7 @@ struct jffs2_eraseblock
 
 static inline int jffs2_blocks_use_vmalloc(struct jffs2_sb_info *c)
 {
-	return ((c->flash_size / c->sector_size) * sizeof (struct jffs2_eraseblock)) > (128 * 1024);
+	return ((c->flash_size / c->sector_size) * sizeof (struct jffs2_eraseblock)) > (128L * 1024L);
 }
 
 #define ref_totlen(a, b, c) __jffs2_ref_totlen((a), (b), (c))
diff --git a/cpukit/libfs/src/jffs2/src/os-rtems.h b/cpukit/libfs/src/jffs2/src/os-rtems.h
index 78e2c6c..7946f85 100644
--- a/cpukit/libfs/src/jffs2/src/os-rtems.h
+++ b/cpukit/libfs/src/jffs2/src/os-rtems.h
@@ -42,7 +42,7 @@ struct super_block;
 
 static inline unsigned int full_name_hash(const unsigned char * name, size_t len) {
 
-	unsigned hash = 0;
+	uint32_t hash = 0;
  	while (len--) {
 		hash = (hash << 4) | (hash >> 28);
 		hash ^= *(name++);
-- 
1.9.3




More information about the devel mailing list