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-next>] [day] [month] [year] [list]
Message-Id: <1363093253-17595-1-git-send-email-zhizhou.zh@gmail.com>
Date:	Tue, 12 Mar 2013 21:00:53 +0800
From:	Zhi-zhou Zhang <zhizhou.zh@...il.com>
To:	ralf@...ux-mips.org, linux-mips@...ux-mips.org,
	linux-kernel@...r.kernel.org
Cc:	Zhi-zhou Zhang <zhizhou.zh@...il.com>
Subject: [PATCH] mips: lib/bitops.c: fix wrong return type

Here should return 64-bit types rather than 32-bit types. Or we
may get wrong return value if high 32-bit isn't equal to zero.

Signed-off-by: Zhi-zhou Zhang <zhizhou.zh@...il.com>
---
 arch/mips/include/asm/bitops.h |    8 ++++----
 arch/mips/lib/bitops.c         |   10 ++++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index 71305a8..7502601 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -51,13 +51,13 @@
 void __mips_set_bit(unsigned long nr, volatile unsigned long *addr);
 void __mips_clear_bit(unsigned long nr, volatile unsigned long *addr);
 void __mips_change_bit(unsigned long nr, volatile unsigned long *addr);
-int __mips_test_and_set_bit(unsigned long nr,
+unsigned long __mips_test_and_set_bit(unsigned long nr,
 			    volatile unsigned long *addr);
-int __mips_test_and_set_bit_lock(unsigned long nr,
+unsigned long __mips_test_and_set_bit_lock(unsigned long nr,
 				 volatile unsigned long *addr);
-int __mips_test_and_clear_bit(unsigned long nr,
+unsigned long __mips_test_and_clear_bit(unsigned long nr,
 			      volatile unsigned long *addr);
-int __mips_test_and_change_bit(unsigned long nr,
+unsigned long __mips_test_and_change_bit(unsigned long nr,
 			       volatile unsigned long *addr);
 
 
diff --git a/arch/mips/lib/bitops.c b/arch/mips/lib/bitops.c
index 81f1dcf..f8d14fc 100644
--- a/arch/mips/lib/bitops.c
+++ b/arch/mips/lib/bitops.c
@@ -83,7 +83,7 @@ EXPORT_SYMBOL(__mips_change_bit);
  * @nr: Bit to set
  * @addr: Address to count from
  */
-int __mips_test_and_set_bit(unsigned long nr,
+unsigned long __mips_test_and_set_bit(unsigned long nr,
 			    volatile unsigned long *addr)
 {
 	volatile unsigned long *a = addr;
@@ -109,7 +109,7 @@ EXPORT_SYMBOL(__mips_test_and_set_bit);
  * @nr: Bit to set
  * @addr: Address to count from
  */
-int __mips_test_and_set_bit_lock(unsigned long nr,
+unsigned long __mips_test_and_set_bit_lock(unsigned long nr,
 				 volatile unsigned long *addr)
 {
 	volatile unsigned long *a = addr;
@@ -135,7 +135,8 @@ EXPORT_SYMBOL(__mips_test_and_set_bit_lock);
  * @nr: Bit to clear
  * @addr: Address to count from
  */
-int __mips_test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
+unsigned long __mips_test_and_clear_bit(unsigned long nr,
+				volatile unsigned long *addr)
 {
 	volatile unsigned long *a = addr;
 	unsigned bit = nr & SZLONG_MASK;
@@ -160,7 +161,8 @@ EXPORT_SYMBOL(__mips_test_and_clear_bit);
  * @nr: Bit to change
  * @addr: Address to count from
  */
-int __mips_test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
+unsigned long __mips_test_and_change_bit(unsigned long nr,
+				volatile unsigned long *addr)
 {
 	volatile unsigned long *a = addr;
 	unsigned bit = nr & SZLONG_MASK;
-- 
1.7.9.5

--
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