Date: Sat, 22 Jul 2017 21:29:44 +0000 (UTC) From: Ryan Libby <rlibby@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321376 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <201707222129.v6MLTiLt024385@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rlibby Date: Sat Jul 22 21:29:44 2017 New Revision: 321376 URL: https://svnweb.freebsd.org/changeset/base/321376 Log: linuxkpi compiler.h: avoid gcc -Wunused-value in dummy expressions It looks like the __acquire and __release macros are for the consumption of static analysis tools and have no semantic effect. Transform the definitions from constant expressions to empty statements in order to avoid -Wunused-value from gcc. Likewise avoid future warnings for __chk_{user,io}_ptr, but with a cast to void, because it looks like some linux kernel code may use those in expression contexts. Reviewed by: hselasky, markj Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11695 Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compiler.h Sat Jul 22 17:49:18 2017 (r321375) +++ head/sys/compat/linuxkpi/common/include/linux/compiler.h Sat Jul 22 21:29:44 2017 (r321376) @@ -40,13 +40,13 @@ #define __force #define __nocast #define __iomem -#define __chk_user_ptr(x) 0 -#define __chk_io_ptr(x) 0 +#define __chk_user_ptr(x) ((void)0) +#define __chk_io_ptr(x) ((void)0) #define __builtin_warning(x, y...) (1) #define __acquires(x) #define __releases(x) -#define __acquire(x) 0 -#define __release(x) 0 +#define __acquire(x) do { } while (0) +#define __release(x) do { } while (0) #define __cond_lock(x,c) (c) #define __bitwise #define __devinitdata
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707222129.v6MLTiLt024385>