[dpdk-dev] [PATCH v2] kni: fix compile errors on Oracle Linux6.4 and RHEL6.5
Zhang, Helin
helin.zhang at intel.com
Fri Jun 20 04:08:47 CEST 2014
Hi Thomas
No special reason to avoid using '#define'. I think both are OK.
But inline function can provide more type checks for the input/output parameters. Also inline functions with even only one line code can be seen a lot in that file.
So I assume that it is not mandatory to use '#define' instead.
Regards,
Helin
-----Original Message-----
From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
Sent: Thursday, June 19, 2014 11:33 PM
To: Zhang, Helin
Cc: dev at dpdk.org; Neil Horman
Subject: Re: [dpdk-dev] [PATCH v2] kni: fix compile errors on Oracle Linux6.4 and RHEL6.5
2014-06-11 21:43, Helin Zhang:
> -#if !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >=
> RHEL_RELEASE_VERSION(6,4)) -static inline bool ether_addr_equal(const
> u8 *addr1, const u8 *addr2)
> +static inline bool __kc_ether_addr_equal(const u8 *addr1, const u8
> +*addr2)
> {
> return !compare_ether_addr(addr1, addr2); } -#endif
> +#define ether_addr_equal(_addr1, _addr2)
> +__kc_ether_addr_equal((_addr1),(_addr2))
Why not defining it in one line (as Neil suggested)?
#define ether_addr_equal(_addr1, _addr2) (!compare_ether_addr(addr1, addr2))
--
Thomas
More information about the dev
mailing list