lkml.org 
[lkml]   [2005]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 30/38] CKRM e18: use sizeof instead of #define for the array size in taskclass
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 <sekharan@us.ibm.com>
Signed-off-by: Gerrit Huizenga <gh@us.ibm.com>

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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-06-23 13:04    [W:0.211 / U:4.500 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site