All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 2/6] fs/befs/endian.h: fix sparse warnings
@ 2005-03-19 13:18 domen
  2005-03-20 11:53 ` [patch 2/6 with proper signed-off] " Domen Puncer
  0 siblings, 1 reply; 2+ messages in thread
From: domen @ 2005-03-19 13:18 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, domen, adobriyan




Signed-off-by: Domen Puncer <domen@coderock.org>
---


 kj-domen/fs/befs/endian.h |   24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)

diff -puN fs/befs/endian.h~sparse-fs_befs_endian.h fs/befs/endian.h
--- kj/fs/befs/endian.h~sparse-fs_befs_endian.h	2005-03-18 20:05:24.000000000 +0100
+++ kj-domen/fs/befs/endian.h	2005-03-18 20:05:24.000000000 +0100
@@ -16,9 +16,9 @@ static inline u64
 fs64_to_cpu(const struct super_block *sb, u64 n)
 {
 	if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
-		return le64_to_cpu(n);
+		return le64_to_cpu((__le64 __force) n);
 	else
-		return be64_to_cpu(n);
+		return be64_to_cpu((__be64 __force) n);
 }
 
 static inline u64
@@ -34,9 +34,9 @@ static inline u32
 fs32_to_cpu(const struct super_block *sb, u32 n)
 {
 	if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
-		return le32_to_cpu(n);
+		return le32_to_cpu((__le32 __force) n);
 	else
-		return be32_to_cpu(n);
+		return be32_to_cpu((__be32 __force) n);
 }
 
 static inline u32
@@ -52,9 +52,9 @@ static inline u16
 fs16_to_cpu(const struct super_block *sb, u16 n)
 {
 	if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
-		return le16_to_cpu(n);
+		return le16_to_cpu((__le16 __force) n);
 	else
-		return be16_to_cpu(n);
+		return be16_to_cpu((__be16 __force) n);
 }
 
 static inline u16
@@ -73,15 +73,9 @@ fsrun_to_cpu(const struct super_block *s
 {
 	befs_block_run run;
 
-	if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) {
-		run.allocation_group = le32_to_cpu(n.allocation_group);
-		run.start = le16_to_cpu(n.start);
-		run.len = le16_to_cpu(n.len);
-	} else {
-		run.allocation_group = be32_to_cpu(n.allocation_group);
-		run.start = be16_to_cpu(n.start);
-		run.len = be16_to_cpu(n.len);
-	}
+	run.allocation_group = fs32_to_cpu(sb, n.allocation_group);
+	run.start = fs16_to_cpu(sb, n.start);
+	run.len = fs16_to_cpu(sb, n.len);
 	return run;
 }
 
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 2/6 with proper signed-off] fs/befs/endian.h: fix sparse warnings
  2005-03-19 13:18 [patch 2/6] fs/befs/endian.h: fix sparse warnings domen
@ 2005-03-20 11:53 ` Domen Puncer
  0 siblings, 0 replies; 2+ messages in thread
From: Domen Puncer @ 2005-03-20 11:53 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, adobriyan


Signed-off-by: Alexey Dobriyan <adobriyan@mail.ru>
Signed-off-by: Domen Puncer <domen@coderock.org>
---


 kj-domen/fs/befs/endian.h |   24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)

diff -puN fs/befs/endian.h~sparse-fs_befs_endian.h fs/befs/endian.h
--- kj/fs/befs/endian.h~sparse-fs_befs_endian.h	2005-03-20 12:11:23.000000000 +0100
+++ kj-domen/fs/befs/endian.h	2005-03-20 12:11:23.000000000 +0100
@@ -16,9 +16,9 @@ static inline u64
 fs64_to_cpu(const struct super_block *sb, u64 n)
 {
 	if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
-		return le64_to_cpu(n);
+		return le64_to_cpu((__le64 __force) n);
 	else
-		return be64_to_cpu(n);
+		return be64_to_cpu((__be64 __force) n);
 }
 
 static inline u64
@@ -34,9 +34,9 @@ static inline u32
 fs32_to_cpu(const struct super_block *sb, u32 n)
 {
 	if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
-		return le32_to_cpu(n);
+		return le32_to_cpu((__le32 __force) n);
 	else
-		return be32_to_cpu(n);
+		return be32_to_cpu((__be32 __force) n);
 }
 
 static inline u32
@@ -52,9 +52,9 @@ static inline u16
 fs16_to_cpu(const struct super_block *sb, u16 n)
 {
 	if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
-		return le16_to_cpu(n);
+		return le16_to_cpu((__le16 __force) n);
 	else
-		return be16_to_cpu(n);
+		return be16_to_cpu((__be16 __force) n);
 }
 
 static inline u16
@@ -73,15 +73,9 @@ fsrun_to_cpu(const struct super_block *s
 {
 	befs_block_run run;
 
-	if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) {
-		run.allocation_group = le32_to_cpu(n.allocation_group);
-		run.start = le16_to_cpu(n.start);
-		run.len = le16_to_cpu(n.len);
-	} else {
-		run.allocation_group = be32_to_cpu(n.allocation_group);
-		run.start = be16_to_cpu(n.start);
-		run.len = be16_to_cpu(n.len);
-	}
+	run.allocation_group = fs32_to_cpu(sb, n.allocation_group);
+	run.start = fs16_to_cpu(sb, n.start);
+	run.len = fs16_to_cpu(sb, n.len);
 	return run;
 }
 
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-20 11:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-19 13:18 [patch 2/6] fs/befs/endian.h: fix sparse warnings domen
2005-03-20 11:53 ` [patch 2/6 with proper signed-off] " Domen Puncer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.