All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] looking for a project?
@ 2007-05-24 23:40 Robert P. J. Day
  2007-05-25  1:42 ` Cripps
  2007-05-25 19:43 ` Andi Drebes
  0 siblings, 2 replies; 3+ messages in thread
From: Robert P. J. Day @ 2007-05-24 23:40 UTC (permalink / raw)
  To: kernel-janitors


  there's still lots to be done here:

http://fsdev.net/wiki/index.php?title=ARRAY_SIZE

with respect to replacing all those silly C constructs that calculate
an array size with the ARRAY_SIZE macro.

  and i wouldn't even try to do it automatically with a script, since
there are numerous places where you can be a bit more clever than just
a mindless substitution.

  for instance, there are places in the tree that define their own
version of that macro:

drivers/ide/ide-cd.h:#define ARY_LEN(a) ((sizeof(a) / sizeof(a[0])))

that suggests that the ide-cd code uses ARY_LEN() at least once.  so
you could not only replace those calls to ARY_LEN with ARRAY_SIZE, but
you could then delete the macro definition of ARY_LEN.

  if you want to see where similar things are done, just run:

$ grep -r "define.*sizeof.*/.*sizeof" *

of course, not all of those hits represent possible changes, but
there's no lack of work there.

rday

-- 
====================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
====================================
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-25 19:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-24 23:40 [KJ] looking for a project? Robert P. J. Day
2007-05-25  1:42 ` Cripps
2007-05-25 19:43 ` Andi Drebes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.