public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: domen@coderock.org
To: rathamahata@php4.ru
Cc: linux-kernel@vger.kernel.org, Alexey Dobriyan <adobriyan@mail.ru>,
	domen@coderock.org
Subject: [patch 1/1] fs/befs/endian.h: fix sparse warnings
Date: Mon, 20 Jun 2005 23:55:30 +0200	[thread overview]
Message-ID: <20050620215529.609366000@nd47.coderock.org> (raw)

[-- Attachment #1: sparse-fs_befs_endian.h.patch --]
[-- Type: text/plain, Size: 1896 bytes --]

From: Alexey Dobriyan <adobriyan@mail.ru>


Signed-off-by: Alexey Dobriyan <adobriyan@mail.ru>
Signed-off-by: Domen Puncer <domen@coderock.org>
---
 endian.h |   24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)

Index: quilt/fs/befs/endian.h
===================================================================
--- quilt.orig/fs/befs/endian.h
+++ quilt/fs/befs/endian.h
@@ -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;
 }
 

--

                 reply	other threads:[~2005-06-21  5:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050620215529.609366000@nd47.coderock.org \
    --to=domen@coderock.org \
    --cc=adobriyan@mail.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rathamahata@php4.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox