mirror of https://gitlab.com/qemu-project/dtc.git
util: add common ARRAY_SIZE define
I want to use this in more places, so put it in util.h rather than copying & pasting it into another file. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
b9e80656f2
commit
4ad49c3a9c
|
@ -50,8 +50,6 @@ static int saw_hyphen; /* = 0 */
|
||||||
static unsigned long long last_val;
|
static unsigned long long last_val;
|
||||||
static char *last_name; /* = NULL */
|
static char *last_name; /* = NULL */
|
||||||
|
|
||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
|
||||||
|
|
||||||
const struct {
|
const struct {
|
||||||
const char *pattern;
|
const char *pattern;
|
||||||
int obase, width;
|
int obase, width;
|
||||||
|
|
1
dtc.h
1
dtc.h
|
@ -66,7 +66,6 @@ typedef uint32_t cell_t;
|
||||||
#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0)
|
#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0)
|
||||||
|
|
||||||
#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
|
#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
|
||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
|
||||||
|
|
||||||
/* Data blobs */
|
/* Data blobs */
|
||||||
enum markertype {
|
enum markertype {
|
||||||
|
|
Loading…
Reference in New Issue