lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47BA132B.4050005@tiscali.nl>
Date:	Tue, 19 Feb 2008 00:22:19 +0100
From:	Roel Kluin <12o3l@...cali.nl>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	marcin.slusarz@...il.com, LKML <linux-kernel@...r.kernel.org>,
	Evgeniy Dushistov <dushistov@...l.ru>
Subject: Re: [PATCH] ufs: [bl]e*_add_cpu conversion

Andrew Morton wrote:
> On Wed, 13 Feb 2008 10:41:44 +0100 Roel Kluin <12o3l@...cali.nl> wrote:
> 
>> you may also want these:
>> ---
>> [bl]e_add_cpu conversion in return

> upsets powerpc (at least):
> 
> fs/ufs/swab.h: In function `fs64_add':
> fs/ufs/swab.h:47: warning: passing arg 1 of `le64_add_cpu' from incompatible pointer type
> fs/ufs/swab.h:49: warning: passing arg 1 of `be64_add_cpu' from incompatible pointer type
> fs/ufs/swab.h: In function `fs64_sub':
> fs/ufs/swab.h:58: warning: passing arg 1 of `le64_add_cpu' from incompatible pointer type
> fs/ufs/swab.h:60: warning: passing arg 1 of `be64_add_cpu' from incompatible pointer type

sorry for this. Is it correct to cast like the patch below does?
If not (anyone) feel free to correct and send a patch yourself.
The patch below was *not* tested
---
[bl]e_add_cpu conversion in return (with cast)

Signed-off-by: Roel Kluin <12o3l@...cali.nl>
---
diff --git a/fs/ufs/swab.h b/fs/ufs/swab.h
index 1683d2b..594d6e8 100644
--- a/fs/ufs/swab.h
+++ b/fs/ufs/swab.h
@@ -44,18 +44,22 @@ static __inline u32
 fs64_add(struct super_block *sbp, u32 *n, int d)
 {
 	if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
-		return *n = cpu_to_le64(le64_to_cpu(*n)+d);
+		le64_add_cpu((__le64 *)n, d);
 	else
-		return *n = cpu_to_be64(be64_to_cpu(*n)+d);
+		be64_add_cpu((__le64 *)n, d);
+
+	return *n;
 }
 
 static __inline u32
 fs64_sub(struct super_block *sbp, u32 *n, int d)
 {
 	if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
-		return *n = cpu_to_le64(le64_to_cpu(*n)-d);
+		le64_add_cpu((__le64 *)n, -d);
 	else
-		return *n = cpu_to_be64(be64_to_cpu(*n)-d);
+		be64_add_cpu((__le64 *)n, -d);
+
+	return *n;
 }
 
 static __inline u32
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ