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: <20210602231443.4670-2-rdunlap@infradead.org>
Date:   Wed,  2 Jun 2021 16:14:41 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     linux-kernel@...r.kernel.org
Cc:     Randy Dunlap <rdunlap@...radead.org>,
        Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Rich Felker <dalias@...c.org>, linux-sh@...r.kernel.org,
        David Howells <dhowells@...hat.com>
Subject: [PATCH 1/4] sh: convert xchg() to a statement expression

Use a GCC statement expression (extension) for xchg(), as is done
in other arches.

Fixes this build warning:

../fs/ocfs2/file.c: In function 'ocfs2_file_write_iter':
../arch/sh/include/asm/cmpxchg.h:49:3: warning: value computed is not used [-Wunused-value]
   49 |  ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))

Fixes: e839ca528718 ("Disintegrate asm/system.h for SH")
Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
Cc: Yoshinori Sato <ysato@...rs.sourceforge.jp>
Cc: Rich Felker <dalias@...c.org>
Cc: linux-sh@...r.kernel.org
Cc: David Howells <dhowells@...hat.com>
---
This is similar to a patch from Arnd for m68k:
  https://lore.kernel.org/linux-m68k/20201008123429.1133896-1-arnd@arndb.de/

 arch/sh/include/asm/cmpxchg.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20210528.orig/arch/sh/include/asm/cmpxchg.h
+++ linux-next-20210528/arch/sh/include/asm/cmpxchg.h
@@ -46,7 +46,7 @@ extern void __xchg_called_with_bad_point
 })
 
 #define xchg(ptr,x)	\
-	((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))
+	({(__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr)));})
 
 /* This function doesn't exist, so you'll get a linker error
  * if something tries to do an invalid cmpxchg(). */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ