aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/kobj.h
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2009-06-11 17:21:14 +0000
committerAndriy Gapon <avg@FreeBSD.org>2009-06-11 17:21:14 +0000
commit198f4cc7b6508a9781f30cab725dd134072c1dc0 (patch)
tree154da9322e0f8897074b3f15bb7a18622a26ff98 /sys/sys/kobj.h
parent65f44679389a47c468e348f9581ef6e0eb91863b (diff)
downloadsrc-198f4cc7b6508a9781f30cab725dd134072c1dc0.tar.gz
src-198f4cc7b6508a9781f30cab725dd134072c1dc0.zip
KOBJMETHOD: use better construct in the checking version of the macro
Big thanks to Christoph Mallon for the idea/code! This construct has benefit of sticking much stricter to C standard and thus keeping more compilers happy as Clang doesn't like the current construct because it doesn't treat FUNC != NULL as a compile-time constant. The checking version is still under 'notyet'. Pointed out by: ed Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Clang help by: rdivacky Reviewed by: imp Approved by: jhb
Notes
Notes: svn path=/head/; revision=194028
Diffstat (limited to 'sys/sys/kobj.h')
-rw-r--r--sys/sys/kobj.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/kobj.h b/sys/sys/kobj.h
index 385a2c3fc686..84f03d9216c9 100644
--- a/sys/sys/kobj.h
+++ b/sys/sys/kobj.h
@@ -96,7 +96,7 @@ struct kobjop_desc {
#define KOBJMETHOD(NAME, FUNC) { &NAME##_desc, (kobjop_t) FUNC }
#else /* notyet */
#define KOBJMETHOD(NAME, FUNC) \
-{ &NAME##_desc, (kobjop_t) (FUNC != (NAME##_t *)NULL ? FUNC : NULL) }
+ { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) }
#endif
/*