diff mbox series

[04/18] xfsprogs: avoid redefinition of NBBY

Message ID 1539201682-22198-5-git-send-email-sandeen@redhat.com (mailing list archive)
State Accepted
Headers show
Series xfsprogs: finer-grained sparse fixes | expand

Commit Message

Eric Sandeen Oct. 10, 2018, 8:01 p.m. UTC
Include sys/param.h for NBBY definition.  Do this before our local
guarded definition which is for platforms like android that don't have it,
see commit:

c9a90185 xfsprogs: define NBBY if not defined by the system header files

Fixes sparse warnings about this redefinition.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 include/platform_defs.h.in | 2 ++
 1 file changed, 2 insertions(+)

Comments

Christoph Hellwig Oct. 11, 2018, 5:59 a.m. UTC | #1
On Wed, Oct 10, 2018 at 03:01:08PM -0500, Eric Sandeen wrote:
> Include sys/param.h for NBBY definition.  Do this before our local
> guarded definition which is for platforms like android that don't have it,
> see commit:
> 
> c9a90185 xfsprogs: define NBBY if not defined by the system header files
> 
> Fixes sparse warnings about this redefinition.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in
index c4f0e8b..d111ec6 100644
--- a/include/platform_defs.h.in
+++ b/include/platform_defs.h.in
@@ -19,6 +19,7 @@ 
 #include <pthread.h>
 #include <ctype.h>
 #include <sys/types.h>
+#include <sys/param.h>
 #include <limits.h>
 #include <stdbool.h>
 #include <libgen.h>
@@ -65,6 +66,7 @@  typedef unsigned short umode_t;
 #define max(a,b)	(((a)>(b))?(a):(b))
 #endif
 
+/* If param.h doesn't provide it, i.e. for Android */
 #ifndef NBBY
 #define NBBY 8
 #endif