Skip to contentSkip to conversation

parser: add const to parser token table

RFC In review Steven Whitehouse 3 participants 3 messages Jul 17, 2008 – Jul 20, 2008

lore
Share & tools
lore
#0 lore raw

RFC 1/1 parser: add const to parser token table

Hi,

Any objections to the following patch? If not I'll send it on to Linus.

This patch adds a "const" to the parser token table. I've done an allmodconfig build to see if this produces any warnings/failures and the patch includes a fix for the only warning that was produced.

Cc Alexander Viro <[email protected]>
Cc Evgeniy Dushistov <[email protected]>
fs/ufs/super.c +1 -1
index 85b22b5..506f724 100644
@@ -1232,7 +1232,7 @@ static int ufs_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {
 	struct ufs_sb_info *sbi = UFS_SB(vfs->mnt_sb);
 	unsigned mval = sbi->s_mount_opt & UFS_MOUNT_UFSTYPE;
-	struct match_token *tp = tokens;
+	const struct match_token *tp = tokens;
 
 	while (tp->token != Opt_onerror_panic && tp->token != mval)
 		++tp;
include/linux/parser.h +1 -1
index 7dcd050..cc554ca 100644
@@ -14,7 +14,7 @@ struct match_token {
 	const char *pattern;
 };
 
-typedef struct match_token match_table_t[];
+typedef const struct match_token match_table_t[];
 
 /* Maximum number of arguments that match_token will find in a pattern */
 enum {MAX_OPT_ARGS = 3};
Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines · Steven Whitehouse

Hi,

Any objections to the following patch? If not I'll send it on to Linus.

This patch adds a "const" to the parser token table. I've done an allmodconfig build to see if this produces any warnings/failures and the patch includes a fix for the only warning that was produced.

Cc Alexander Viro <[email protected]>
Cc Evgeniy Dushistov <[email protected]>
fs/ufs/super.c +1 -1
index 85b22b5..506f724 100644
@@ -1232,7 +1232,7 @@ static int ufs_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {
 	struct ufs_sb_info *sbi = UFS_SB(vfs->mnt_sb);
 	unsigned mval = sbi->s_mount_opt & UFS_MOUNT_UFSTYPE;
-	struct match_token *tp = tokens;
+	const struct match_token *tp = tokens;
 
 	while (tp->token != Opt_onerror_panic && tp->token != mval)
 		++tp;
include/linux/parser.h +0 -0
index 7dcd050..cc554ca 100644

include/linux/parser.h struct match_token { · line 20

Quoted 8 lines
include/linux/parser.h +1 -1
@@ -14,7 +14,7 @@ struct match_token {
 	const char *pattern;
 };
 
-typedef struct match_token match_table_t[];
+typedef const struct match_token match_table_t[];
 
 /* Maximum number of arguments that match_token will find in a pattern */
 enum {MAX_OPT_ARGS = 3};
Signature · 1 line
/Evgeniy
#2 lore raw
In reply to Steven Whitehouse
Quoted 11 lines · Steven Whitehouse

Hi,

Any objections to the following patch? If not I'll send it on to Linus.

This patch adds a "const" to the parser token table. I've done an allmodconfig build to see if this produces any warnings/failures and the patch includes a fix for the only warning that was produced.

Cc Alexander Viro <[email protected]>
Cc Evgeniy Dushistov <[email protected]>

ACK