[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <loom.20101217T115727-612@post.gmane.org>
Date: Fri, 17 Dec 2010 11:02:26 +0000 (UTC)
From: Francis Galiegue <fgaliegue@...il.com>
To: linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 1/7] drivers:media:radio: wl128x: fmdrv common header file
manjunatha_halli <at> ti.com> writes:
[...]
> +
> +#define NO_OF_ENTRIES_IN_ARRAY(array) (sizeof(array) / sizeof(array[0]))
> +
Hello,
There is already ARRAY_SIZE() defined in <linux/kernel.h>. And while we're at
it, git grep '#define ARRAY_SIZE' tells that there are 4 definitions in arch:
arch/powerpc/boot/types.h:#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
arch/um/include/shared/user.h:#define ARRAY_SIZE(x) (sizeof(x) /
sizeof((x)[0]))
arch/x86/boot/boot.h:#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
arch/x86/boot/compressed/relocs.c:#define ARRAY_SIZE(x) (sizeof(x) /
sizeof((x)[0]))
include/linux/kernel.h:#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])
+ __must_be_array(arr))
Does the __must_be_array() cause trouble with arch/? If not, shouldn't these
definitions be merged?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists