[build] Provide common ARRAY_SIZE() definition

Several files define the ARRAY_SIZE() macro as used in Linux.  Provide
a common definition for this in include/compiler.h.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2017-03-10 15:40:17 +00:00
parent 4524cc11bf
commit afdebdc163
9 changed files with 9 additions and 19 deletions

View File

@@ -30,7 +30,6 @@ FILE_LICENCE(GPL2_ONLY);
#define RTL8225_ANAPARAM2_OFF 0x840dec11
#define min(a,b) (((a)<(b))?(a):(b))
#define ARRAY_SIZE(a) (int)(sizeof(a)/sizeof((a)[0]))
static inline void rtl8225_write_phy_ofdm(struct net80211_device *dev,
u8 addr, u8 data)
@@ -323,7 +322,7 @@ static void rtl8225_rf_set_tx_power(struct net80211_device *dev, int channel)
static void rtl8225_rf_init(struct net80211_device *dev)
{
struct rtl818x_priv *priv = dev->priv;
int i;
unsigned int i;
rtl818x_set_anaparam(priv, RTL8225_ANAPARAM_ON);
@@ -552,7 +551,7 @@ static const u16 rtl8225z2_rxgain[] = {
static void rtl8225z2_rf_init(struct net80211_device *dev)
{
struct rtl818x_priv *priv = dev->priv;
int i;
unsigned int i;
rtl818x_set_anaparam(priv, RTL8225_ANAPARAM_ON);