]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-cli: Fix build on aarch64-linux-android-4.9
authorRakesh Pandit <rakesh@tuxera.com>
Mon, 24 Apr 2017 07:44:17 +0000 (10:44 +0300)
committerKeith Busch <keith.busch@intel.com>
Mon, 24 Apr 2017 15:07:12 +0000 (11:07 -0400)
Need to include sys/stat.h to fix:
fabrics.c:414:45: error: 'S_IRUSR' undeclared (first use in this function)
fabrics.c:414:53: error: 'S_IWUSR' undeclared (first use in this function)

Also fix warning:
common.h:4:0:
warning: "offsetof" redefined #define offsetof(x, y)
__builtin_offsetof(x, y) ^

Fix this trivial warning by including stddef.h and removing this
definition.

Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
common.h
fabrics.c

index f0a94de5706127f0a751b7b33ae7ecd4ecfec022..8338a3d0294127939bf290bbef6bf023b1766ee1 100644 (file)
--- a/common.h
+++ b/common.h
@@ -1,8 +1,6 @@
 #ifndef _COMMON_H
 #define _COMMON_H
 
-#define offsetof(x, y) __builtin_offsetof(x, y)
-
 #define __round_mask(x, y) ((__typeof__(x))((y)-1))
 #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
 
index a2e8f602ed9abee178ebf53c49ce16ce44a820b2..6648bae42cf7f8d5807d6a68fab5b2ed665d63fe 100644 (file)
--- a/fabrics.c
+++ b/fabrics.c
@@ -32,6 +32,8 @@
 #include <inttypes.h>
 #include <linux/types.h>
 #include <libgen.h>
+#include <sys/stat.h>
+#include <stddef.h>
 
 #include "parser.h"
 #include "nvme-ioctl.h"