[ethtool] 09/20: internal.h: change to new sane kernel headers on 64-bit archs

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Mon Mar 14 11:37:16 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository ethtool.

commit c0a2c04b3cbf6d399a2551654401957ddb529a50
Author: Maciej Żenczykowski <maze at google.com>
Date:   Fri Mar 11 09:58:14 2016 -0800

    internal.h: change to new sane kernel headers on 64-bit archs
    
    On ppc64, this fixes:
      In file included from ethtool-copy.h:22:0,
                       from internal.h:32,
                       from ethtool.c:29:
      .../include/linux/types.h:32:25: error: conflicting types for '__be64'
       typedef __u64 __bitwise __be64;
                               ^
      In file included from ethtool.c:29:0:
      internal.h:23:28: note: previous declaration of '__be64' was here
       typedef unsigned long long __be64;
                                  ^
      ethtool.c: In function 'do_gstats':
      ethtool.c:3166:4: error: format '%llu' expects argument of type 'long long unsigned int', but argument 5 has type '__u64' [-Werror=format=]
          stats->data[i]);
          ^
      ethtool.c: In function 'print_indir_table':
      ethtool.c:3293:9: error: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type '__u64' [-Werror=format=]
               ctx->devname, ring_count->data);
               ^
    
    Signed-off-by: Maciej Żenczykowski <maze at google.com>
    Signed-off-by: David Decotigny <decot at googlers.com>
    Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
 internal.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/internal.h b/internal.h
index f58c3d4..e98f532 100644
--- a/internal.h
+++ b/internal.h
@@ -3,6 +3,12 @@
 #ifndef ETHTOOL_INTERNAL_H__
 #define ETHTOOL_INTERNAL_H__
 
+/* Some platforms (eg. ppc64) need __SANE_USERSPACE_TYPES__ before
+ * <linux/types.h> to select 'int-ll64.h' and avoid compile warnings
+ * when printing __u64 with %llu.
+ */
+#define __SANE_USERSPACE_TYPES__
+
 #ifdef HAVE_CONFIG_H
 #include "ethtool-config.h"
 #endif

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/ethtool.git



More information about the Kernel-svn-changes mailing list