Skip to content

Commit

Permalink
net/ionic: fix build with Fedora Rawhide
Browse files Browse the repository at this point in the history
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: 5ef5180 ("net/ionic: register and initialize adapter")

Signed-off-by: Timothy Redaelli <[email protected]>
  • Loading branch information
drizzt authored and steevenlee committed Oct 27, 2024
1 parent ff3018e commit e837f2e
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions drivers/net/ionic/ionic_osdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit e837f2e

Please sign in to comment.