A few functions in sys/sys/tree.h are marked void, but they have return
statements that try to pass something back.  I suspect these weren't
detected by clang because of the __unused flag.

The below patch removes the return statements.

I compiled and ran this modification on my personal server and it
doesn't seem to have any negative effects.

Index: sys/sys/tree.h
===================================================================
RCS file: /cvs/src/sys/sys/tree.h,v
retrieving revision 1.29
diff -u -p -r1.29 tree.h
--- sys/sys/tree.h      30 Jul 2017 19:27:20 -0000      1.29
+++ sys/sys/tree.h      24 Mar 2019 00:10:47 -0000
@@ -910,25 +910,25 @@ _name##_RBT_PARENT(struct _type *elm)                     
 __unused static inline void                                            \
 _name##_RBT_SET_LEFT(struct _type *elm, struct _type *left)            \
 {                                                                      \
-       return _rb_set_left(_name##_RBT_TYPE, elm, left);               \
+       _rb_set_left(_name##_RBT_TYPE, elm, left);                      \
 }                                                                      \
                                                                        \
 __unused static inline void                                            \
 _name##_RBT_SET_RIGHT(struct _type *elm, struct _type *right)          \
 {                                                                      \
-       return _rb_set_right(_name##_RBT_TYPE, elm, right);             \
+       _rb_set_right(_name##_RBT_TYPE, elm, right);                    \
 }                                                                      \
                                                                        \
 __unused static inline void                                            \
 _name##_RBT_SET_PARENT(struct _type *elm, struct _type *parent)                
\
 {                                                                      \
-       return _rb_set_parent(_name##_RBT_TYPE, elm, parent);           \
+       _rb_set_parent(_name##_RBT_TYPE, elm, parent);                  \
 }                                                                      \
                                                                        \
 __unused static inline void                                            \
 _name##_RBT_POISON(struct _type *elm, unsigned long poison)            \
 {                                                                      \
-       return _rb_poison(_name##_RBT_TYPE, elm, poison);               \
+       _rb_poison(_name##_RBT_TYPE, elm, poison);                      \
 }                                                                      \
                                                                        \
 __unused static inline int                                             \
@@ -956,7 +956,7 @@ static void                                                 
        \
 _name##_RBT_AUGMENT(void *ptr)                                         \
 {                                                                      \
        struct _type *p = ptr;                                          \
-       return _aug(p);                                                 \
+       _aug(p);                                                        \
 }                                                                      \
 RBT_GENERATE_INTERNAL(_name, _type, _field, _cmp, _name##_RBT_AUGMENT)
 

Reply via email to