Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600571

[PATCH 1/3] openrisc: xchg: fix `computed is not used` warning

From Stafford Horne <shorne@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/3] openrisc: xchg: fix `computed is not used` warning
Date 2017-03-14 16:10 +0100
Message-ID <tkWfi-1T2-71@gated-at.bofh.it> (permalink)
References <tkW5A-1Ad-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


When building allmodconfig this warning shows.

  fs/ocfs2/file.c: In function 'ocfs2_file_write_iter':
  ./arch/openrisc/include/asm/cmpxchg.h:81:3: warning: value computed is
  not used [-Wunused-value]
    ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), sizeof(*(ptr))))
     ^

Applying the same patch logic that was done to the cmpxchg macro.

Signed-off-by: Stafford Horne <shorne@gmail.com>
---
 arch/openrisc/include/asm/cmpxchg.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/openrisc/include/asm/cmpxchg.h b/arch/openrisc/include/asm/cmpxchg.h
index 5fcb9ac..f0a5d8b 100644
--- a/arch/openrisc/include/asm/cmpxchg.h
+++ b/arch/openrisc/include/asm/cmpxchg.h
@@ -77,7 +77,11 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr,
 	return val;
 }
 
-#define xchg(ptr, with) \
-	((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), sizeof(*(ptr))))
+#define xchg(ptr, with) 						\
+	({								\
+		(__typeof__(*(ptr))) __xchg((unsigned long)(with),	\
+					    (ptr),			\
+					    sizeof(*(ptr)));		\
+	})
 
 #endif /* __ASM_OPENRISC_CMPXCHG_H */
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] Openrisc fixes for 4.11 Stafford Horne <shorne@gmail.com> - 2017-03-14 16:00 +0100
  [PATCH 2/3] openrisc: fix issue handling 8 byte get_user calls Stafford Horne <shorne@gmail.com> - 2017-03-14 16:00 +0100
  [PATCH 3/3] openrisc: Export symbols needed by modules Stafford Horne <shorne@gmail.com> - 2017-03-14 16:00 +0100
    Re: [OpenRISC] [PATCH 3/3] openrisc: Export symbols needed by modules Geert Uytterhoeven <geert@linux-m68k.org> - 2017-03-14 16:30 +0100
      Re: [OpenRISC] [PATCH 3/3] openrisc: Export symbols needed by modules Stafford Horne <shorne@gmail.com> - 2017-03-14 23:20 +0100
  [PATCH 1/3] openrisc: xchg: fix `computed is not used` warning Stafford Horne <shorne@gmail.com> - 2017-03-14 16:10 +0100

csiph-web