[patch 30/38] CKRM e18: use sizeof instead of #define for the array size in taskclass

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While creating the config files for taskclass, instead of using #define
use sizeof so that when the array size changes, things still work as
expected.

Note: Socketclass already follows this model.

Signed-off-by:  Chandra Seetharaman <[email protected]>
Signed-off-by:  Gerrit Huizenga <[email protected]>

Index: linux-2.6.12-ckrm1/fs/rcfs/tc_magic.c
===================================================================
--- linux-2.6.12-ckrm1.orig/fs/rcfs/tc_magic.c	2005-06-20 15:02:49.000000000 -0700
+++ linux-2.6.12-ckrm1/fs/rcfs/tc_magic.c	2005-06-20 15:37:43.000000000 -0700
@@ -34,8 +34,7 @@
 
 #define TC_FILE_MODE (S_IFREG | S_IRUGO | S_IWUSR)
 
-#define NR_TCROOTMF  7
-struct rcfs_magf tc_rootdesc[NR_TCROOTMF] = {
+struct rcfs_magf tc_rootdesc[] = {
 	/* First entry must be root */
 	{
 	/* .name = should not be set, copy from classtype name */
@@ -89,5 +88,5 @@ struct rcfs_magf tc_rootdesc[NR_TCROOTMF
 
 struct rcfs_mfdesc tc_mfdesc = {
 	.rootmf = tc_rootdesc,
-	.rootmflen = NR_TCROOTMF,
+	.rootmflen = (sizeof(tc_rootdesc) / sizeof(struct rcfs_magf)),
 };

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux