mirror of
https://github.com/ipxe/ipxe
synced 2026-01-02 18:03:36 +03:00
[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:
@@ -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))
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user