patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Timothy Redaelli <tredaelli@redhat.com>
To: stable@dpdk.org
Subject: [PATCH 23.11] net/ionic: fix build with Fedora Rawhide
Date: Thu, 24 Oct 2024 11:30:06 +0200	[thread overview]
Message-ID: <b0d2381ba889e22ee0f695e2a27043c6ab5c068d.1729760024.git.tredaelli@redhat.com> (raw)

Currently, a number of integer types are typedef'd to their corresponding
userspace or RTE values. This can be problematic if these types are
already defined somewhere else, as it would cause type collisions.
This patch changes the typedefs to #define macros which are only defined
if the types are not defined already.

Fixes: 5ef518098ec6 ("net/ionic: register and initialize adapter")

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
Backport of f0d9e787747d ("net/gve/base: fix build with Fedora Rawhide")
is also needed on stable branches. My commit is not needed on
main since it was fixed silently in 484027bf9452 ("common/ionic: create common
code library").
---
 drivers/net/ionic/ionic_osdep.h | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ionic/ionic_osdep.h b/drivers/net/ionic/ionic_osdep.h
index 68f767b920..97188dfd59 100644
--- a/drivers/net/ionic/ionic_osdep.h
+++ b/drivers/net/ionic/ionic_osdep.h
@@ -30,14 +30,28 @@
 
 #define __iomem
 
-typedef uint8_t	 u8;
-typedef uint16_t u16;
-typedef uint32_t u32;
-typedef uint64_t u64;
-
-typedef uint16_t __le16;
-typedef uint32_t __le32;
-typedef uint64_t __le64;
+#ifndef u8
+#define u8 uint8_t
+#endif
+#ifndef u16
+#define u16 uint16_t
+#endif
+#ifndef u32
+#define u32 uint32_t
+#endif
+#ifndef u64
+#define u64 uint64_t
+#endif
+
+#ifndef __le16
+#define __le16 rte_le16_t
+#endif
+#ifndef __le32
+#define __le32 rte_le32_t
+#endif
+#ifndef __le64
+#define __le64 rte_le64_t
+#endif
 
 #define ioread8(reg)		rte_read8(reg)
 #define ioread32(reg)		rte_read32(rte_le_to_cpu_32(reg))
-- 
2.47.0


             reply	other threads:[~2024-10-24  9:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24  9:30 Timothy Redaelli [this message]
2024-10-24 10:12 ` David Marchand
2024-10-27  8:05   ` Xueming Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0d2381ba889e22ee0f695e2a27043c6ab5c068d.1729760024.git.tredaelli@redhat.com \
    --to=tredaelli@redhat.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).