* [PATCH] ethtool: change to new sane powerpc64 kernel headers
@ 2018-12-15 1:19 Maciej Żenczykowski
2018-12-15 12:30 ` Ben Hutchings
2019-01-18 18:40 ` John W. Linville
0 siblings, 2 replies; 3+ messages in thread
From: Maciej Żenczykowski @ 2018-12-15 1:19 UTC (permalink / raw)
To: Maciej Żenczykowski, Jeff Garzik, Ben Hutchings
Cc: David S . Miller, David Decotigny, netdev
From: Maciej Żenczykowski <maze@google.com>
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);
^
$ gcc -dM -E - <<< "" | egrep -i 'power|ppc|arm|aarch|x86|86|amd'
.#define __x86_64 1
.#define __amd64 1
.#define __x86_64__ 1
.#define __amd64__ 1
.#define _ARCH_PPCGR 1
.#define __PPC64__ 1
.#define _ARCH_PPC 1
.#define __powerpc64__ 1
.#define __PPC__ 1
.#define __powerpc__ 1
.#define _ARCH_PPC64 1
.#define __AARCH64_CMODEL_SMALL__ 1
.#define __aarch64__ 1
.#define __AARCH64EL__ 1
.#define __ARM_NEON 1
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
ethtool-copy.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/ethtool-copy.h b/ethtool-copy.h
index 6bfbb85f9402..7772a4970987 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -14,6 +14,12 @@
#ifndef _LINUX_ETHTOOL_H
#define _LINUX_ETHTOOL_H
+#ifdef __powerpc64__
+/* Powerpc needs __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__
+#endif
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/if_ether.h>
--
2.20.0.405.gbc1bbc6f85-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ethtool: change to new sane powerpc64 kernel headers
2018-12-15 1:19 [PATCH] ethtool: change to new sane powerpc64 kernel headers Maciej Żenczykowski
@ 2018-12-15 12:30 ` Ben Hutchings
2019-01-18 18:40 ` John W. Linville
1 sibling, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2018-12-15 12:30 UTC (permalink / raw)
To: Maciej Żenczykowski, Maciej Żenczykowski, Jeff Garzik,
John W. Linville
Cc: David S . Miller, David Decotigny, netdev
[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]
On Fri, 2018-12-14 at 17:19 -0800, Maciej Żenczykowski wrote:
> From: Maciej Żenczykowski <maze@google.com>
>
> 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);
> ^
>
> $ gcc -dM -E - <<< "" | egrep -i 'power|ppc|arm|aarch|x86|86|amd'
>
> .#define __x86_64 1
> .#define __amd64 1
> .#define __x86_64__ 1
> .#define __amd64__ 1
>
> .#define _ARCH_PPCGR 1
> .#define __PPC64__ 1
> .#define _ARCH_PPC 1
> .#define __powerpc64__ 1
> .#define __PPC__ 1
> .#define __powerpc__ 1
> .#define _ARCH_PPC64 1
>
> .#define __AARCH64_CMODEL_SMALL__ 1
> .#define __aarch64__ 1
> .#define __AARCH64EL__ 1
> .#define __ARM_NEON 1
>
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
> ---
> ethtool-copy.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/ethtool-copy.h b/ethtool-copy.h
> index 6bfbb85f9402..7772a4970987 100644
> --- a/ethtool-copy.h
> +++ b/ethtool-copy.h
> @@ -14,6 +14,12 @@
> #ifndef _LINUX_ETHTOOL_H
> #define _LINUX_ETHTOOL_H
>
> +#ifdef __powerpc64__
> +/* Powerpc needs __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__
> +#endif
> #include <linux/kernel.h>
> #include <linux/types.h>
> #include <linux/if_ether.h>
--
Ben Hutchings
If you seem to know what you are doing, you'll be given more to do.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ethtool: change to new sane powerpc64 kernel headers
2018-12-15 1:19 [PATCH] ethtool: change to new sane powerpc64 kernel headers Maciej Żenczykowski
2018-12-15 12:30 ` Ben Hutchings
@ 2019-01-18 18:40 ` John W. Linville
1 sibling, 0 replies; 3+ messages in thread
From: John W. Linville @ 2019-01-18 18:40 UTC (permalink / raw)
To: Maciej Żenczykowski
Cc: Maciej Żenczykowski, Jeff Garzik, Ben Hutchings,
David S . Miller, David Decotigny, netdev
On Fri, Dec 14, 2018 at 05:19:36PM -0800, Maciej Żenczykowski wrote:
> From: Maciej Żenczykowski <maze@google.com>
>
> 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);
> ^
>
> $ gcc -dM -E - <<< "" | egrep -i 'power|ppc|arm|aarch|x86|86|amd'
>
> .#define __x86_64 1
> .#define __amd64 1
> .#define __x86_64__ 1
> .#define __amd64__ 1
>
> .#define _ARCH_PPCGR 1
> .#define __PPC64__ 1
> .#define _ARCH_PPC 1
> .#define __powerpc64__ 1
> .#define __PPC__ 1
> .#define __powerpc__ 1
> .#define _ARCH_PPC64 1
>
> .#define __AARCH64_CMODEL_SMALL__ 1
> .#define __aarch64__ 1
> .#define __AARCH64EL__ 1
> .#define __ARM_NEON 1
>
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
Queued for next release.
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-18 18:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-15 1:19 [PATCH] ethtool: change to new sane powerpc64 kernel headers Maciej Żenczykowski
2018-12-15 12:30 ` Ben Hutchings
2019-01-18 18:40 ` John W. Linville
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).