summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/drivers/net/ath/ath.h1
-rw-r--r--src/drivers/net/ath/ath5k/ath5k.h2
-rw-r--r--src/drivers/net/forcedeth.h2
-rw-r--r--src/drivers/net/pcnet32.h2
-rw-r--r--src/drivers/net/rtl818x/rtl8185_rtl8225.c5
-rwxr-xr-xsrc/drivers/net/skge.h3
-rw-r--r--src/drivers/net/tg3/tg3.h2
-rw-r--r--src/drivers/net/vxge/vxge_config.h4
-rw-r--r--src/include/compiler.h7
9 files changed, 9 insertions, 19 deletions
diff --git a/src/drivers/net/ath/ath.h b/src/drivers/net/ath/ath.h
index d6a037394..589bb5634 100644
--- a/src/drivers/net/ath/ath.h
+++ b/src/drivers/net/ath/ath.h
@@ -26,7 +26,6 @@ FILE_LICENCE ( BSD2 );
#include <ipxe/net80211.h>
/* This block of functions are from kernel.h v3.0.1 */
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define BITS_PER_BYTE 8
#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
diff --git a/src/drivers/net/ath/ath5k/ath5k.h b/src/drivers/net/ath/ath5k/ath5k.h
index 30e2024c6..fa62e8ce5 100644
--- a/src/drivers/net/ath/ath5k/ath5k.h
+++ b/src/drivers/net/ath/ath5k/ath5k.h
@@ -34,8 +34,6 @@ FILE_LICENCE ( MIT );
#undef ERRFILE
#define ERRFILE ERRFILE_ath5k
-#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
-
/* RX/TX descriptor hw structs */
#include "desc.h"
diff --git a/src/drivers/net/forcedeth.h b/src/drivers/net/forcedeth.h
index e1cf6f71a..3a372dc1b 100644
--- a/src/drivers/net/forcedeth.h
+++ b/src/drivers/net/forcedeth.h
@@ -36,8 +36,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
#ifndef _FORCEDETH_H_
#define _FORCEDETH_H_
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
struct ring_desc {
u32 buf;
u32 flaglen;
diff --git a/src/drivers/net/pcnet32.h b/src/drivers/net/pcnet32.h
index 5e4492ef9..f06d7fd00 100644
--- a/src/drivers/net/pcnet32.h
+++ b/src/drivers/net/pcnet32.h
@@ -23,8 +23,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
#ifndef _PCNET32_H_
#define _PCNET32_H_
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
/*
* Set the number of Tx and Rx buffers, using Log_2(# buffers).
* Set default values to 16 Tx buffers and 32 Rx buffers.
diff --git a/src/drivers/net/rtl818x/rtl8185_rtl8225.c b/src/drivers/net/rtl818x/rtl8185_rtl8225.c
index ae92531ce..31a740e64 100644
--- a/src/drivers/net/rtl818x/rtl8185_rtl8225.c
+++ b/src/drivers/net/rtl818x/rtl8185_rtl8225.c
@@ -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);
diff --git a/src/drivers/net/skge.h b/src/drivers/net/skge.h
index d9e91457a..b13013bba 100755
--- a/src/drivers/net/skge.h
+++ b/src/drivers/net/skge.h
@@ -65,9 +65,6 @@ FILE_LICENCE ( GPL2_ONLY );
#define SUPPORTED_TP (1 << 7)
#define SUPPORTED_FIBRE (1 << 10)
-/* from kernel.h */
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-
/* ----------------------------------- */
#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \
diff --git a/src/drivers/net/tg3/tg3.h b/src/drivers/net/tg3/tg3.h
index be02c5719..05d516344 100644
--- a/src/drivers/net/tg3/tg3.h
+++ b/src/drivers/net/tg3/tg3.h
@@ -3284,8 +3284,6 @@ struct tg3 {
u16 subsystem_device;
};
-#define ARRAY_SIZE(x) ( sizeof(x) / sizeof((x)[0]) )
-
#define TG3_TX_RING_SIZE 512
#define TG3_DEF_TX_RING_PENDING (TG3_TX_RING_SIZE - 1)
diff --git a/src/drivers/net/vxge/vxge_config.h b/src/drivers/net/vxge/vxge_config.h
index bf25134ad..59e8a7966 100644
--- a/src/drivers/net/vxge/vxge_config.h
+++ b/src/drivers/net/vxge/vxge_config.h
@@ -27,10 +27,6 @@ FILE_LICENCE(GPL2_ONLY);
#define WAIT_FACTOR 1
-#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-#endif
-
#define VXGE_HW_MAC_MAX_WIRE_PORTS 2
#define VXGE_HW_MAC_MAX_AGGR_PORTS 2
#define VXGE_HW_MAC_MAX_PORTS 3
diff --git a/src/include/compiler.h b/src/include/compiler.h
index 4924c7ef5..56a5f63d5 100644
--- a/src/include/compiler.h
+++ b/src/include/compiler.h
@@ -656,6 +656,13 @@ char __debug_disable(OBJECT) = ( DBGLVL_MAX & ~DBGLVL_DFLT );
#endif /* ASSEMBLY */
/**
+ * Array size
+ */
+#ifndef ASSEMBLY
+#define ARRAY_SIZE(array) ( sizeof (array) / sizeof ( (array)[0] ) )
+#endif /* ASSEMBLY */
+
+/**
* @defgroup licences Licence declarations
*
* For reasons that are partly historical, various different files