Skip to contentSkip to conversation

net/ena: Fix build warning in ena_xdp_set()

PATCH Applied Gavin Shan 3 participants 3 messages Apr 28, 2020

Subsystems (3)
lore
Share & tools
lore

Gavin Shan

author
#0 lore raw

PATCH v2 1/1 net/ena: Fix build warning in ena_xdp_set()

This fixes the following build warning in ena_xdp_set(), which is observed on aarch64 with 64KB page size.

   In file included from ./include/net/inet_sock.h:19,
      from ./include/net/ip.h:27,
      from drivers/net/ethernet/amazon/ena/ena_netdev.c:46:
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function         \
   ‘ena_xdp_set’:                                                    \
   drivers/net/ethernet/amazon/ena/ena_netdev.c:557:6: warning:      \
   format ‘%lu’                                                      \
   expects argument of type ‘long unsigned int’, but argument 4      \
   has type ‘int’                                                    \
   [-Wformat=] "Failed to set xdp program, the current MTU (%d) is   \
   larger than the maximum allowed MTU (%lu) while xdp is on",

---
v2: Make ENA_PAGE_SIZE to be "unsigned long" and verify on aarch64
with 4KB or 64KB page size configuration

---
 drivers/net/ethernet/amazon/ena/ena_netdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/amazon/ena/ena_netdev.h +1 -1
index 97dfd0c67e84..9e1860d81908 100644
@@ -69,7 +69,7 @@
  * 16kB.
  */
 #if PAGE_SIZE > SZ_16K
-#define ENA_PAGE_SIZE SZ_16K
+#define ENA_PAGE_SIZE (_AC(SZ_16K, UL))
 #else
 #define ENA_PAGE_SIZE PAGE_SIZE
 #endif
Signature · 1 line
2.23.0
Acked-by on v2 1/1
#1 lore raw
Quoted 28 lines · Gavin Shan

This fixes the following build warning in ena_xdp_set(), which is observed on aarch64 with 64KB page size.

   In file included from ./include/net/inet_sock.h:19,
      from ./include/net/ip.h:27,
      from drivers/net/ethernet/amazon/ena/ena_netdev.c:46:
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function         \
   ‘ena_xdp_set’:                                                    \
   drivers/net/ethernet/amazon/ena/ena_netdev.c:557:6: warning:      \
   format ‘%lu’                                                      \
   expects argument of type ‘long unsigned int’, but argument 4      \
   has type ‘int’                                                    \
   [-Wformat=] "Failed to set xdp program, the current MTU (%d) is   \
   larger than the maximum allowed MTU (%lu) while xdp is on",

---
v2: Make ENA_PAGE_SIZE to be "unsigned long" and verify on aarch64
with 4KB or 64KB page size configuration

---
 drivers/net/ethernet/amazon/ena/ena_netdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/amazon/ena/ena_netdev.h +0 -0
index 97dfd0c67e84..9e1860d81908 100644

drivers/net/ethernet/amazon/ena/ena_netdev.h line 75

Quoted 8 lines
drivers/net/ethernet/amazon/ena/ena_netdev.h +1 -1
@@ -69,7 +69,7 @@
  * 16kB.
  */
 #if PAGE_SIZE > SZ_16K
-#define ENA_PAGE_SIZE SZ_16K
+#define ENA_PAGE_SIZE (_AC(SZ_16K, UL))
 #else
 #define ENA_PAGE_SIZE PAGE_SIZE
 #endif

thanks for this fix

maintainer Applied
#2 lore raw
In reply to Gavin Shan

From: Gavin Shan <[email protected]>
Date: Tue, 28 Apr 2020 14:49:45 +1000

Quoted 15 lines

This fixes the following build warning in ena_xdp_set(), which is observed on aarch64 with 64KB page size.

   In file included from ./include/net/inet_sock.h:19,
      from ./include/net/ip.h:27,
      from drivers/net/ethernet/amazon/ena/ena_netdev.c:46:
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function         \
   ‘ena_xdp_set’:                                                    \
   drivers/net/ethernet/amazon/ena/ena_netdev.c:557:6: warning:      \
   format ‘%lu’                                                      \
   expects argument of type ‘long unsigned int’, but argument 4      \
   has type ‘int’                                                    \
   [-Wformat=] "Failed to set xdp program, the current MTU (%d) is   \
   larger than the maximum allowed MTU (%lu) while xdp is on",
Quoted 4 lines

---
v2: Make ENA_PAGE_SIZE to be "unsigned long" and verify on aarch64
with 4KB or 64KB page size configuration

Applied, thank you.