On Mon, Jun 28, 2010 at 05:15:11PM +0400, Kulikov Vasiliy wrote:
On Mon, Jun 28, 2010 at 14:52 +0200, Dan Carpenter wrote:Right right. But xxxx is a stupid name for a variable. I wanted to
On Mon, Jun 28, 2010 at 03:55:41PM +0400, Kulikov Vasiliy wrote:Look at the patch:
Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).I would say the more critical problem with this macro is that it doesn't
Signed-off-by: Kulikov Vasiliy<segooon@xxxxxxxxx>
---
drivers/staging/wlags49_h2/hcf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/wlags49_h2/hcf.c b/drivers/staging/wlags49_h2/hcf.c
index 390628c..c4fe0ec 100644
--- a/drivers/staging/wlags49_h2/hcf.c
+++ b/drivers/staging/wlags49_h2/hcf.c
@@ -502,7 +502,7 @@ HCF_STATIC hcf_16* BASED xxxx[ ] = {
#endif // MSF_COMPONENT_ID
NULL //endsentinel
};
-#define xxxx_PRI_IDENTITY_OFFSET (sizeof(xxxx)/sizeof(xxxx[0]) - 3)
+#define xxxx_PRI_IDENTITY_OFFSET (ARRAY_SIZE(xxxx) - 3)
work unless you name all your arrays "xxxx[]" so it encourages sub par
variable names.
You could do:
#define PRI_IDENTITY_OFFSET(x) (ARRAY_SIZE(x) - 3)
There is an array called 'xxxx' and macro xxxx_PRI_IDENTITY_OFFSET is defined@@ -502,7 +502,7 @@ HCF_STATIC hcf_16* BASED xxxx[ ] = {
after array definition. This magic macroconstant is used in the code to get
elements of xxxx.
poke my eyes out with a fork.
Not your fault obviously. Your patch doesn't make it worse so I'm fine
with it as far as it goes...
regards,
dan carpenter