Skip to content

Commit

Permalink
fs/fat/inode.c: clean up string initializations (char[] instead of ch…
Browse files Browse the repository at this point in the history
…ar *)

Initializations like 'char *foo = "bar"' will create two variables: a
static string and a pointer (foo) to that static string.  Instead 'char
foo[] = "bar"' will declare a single variable and will end up in shorter
assembly (according to Jeff Garzik on the KernelJanitor's TODO list).

Signed-off-by: Manuel Schölling <[email protected]>
Acked-by: OGAWA Hirofumi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
manuels authored and torvalds committed Jun 6, 2014
1 parent 190a884 commit ef19470
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/fat/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ struct inode *fat_iget(struct super_block *sb, loff_t i_pos)

static int is_exec(unsigned char *extension)
{
unsigned char *exe_extensions = "EXECOMBAT", *walk;
unsigned char exe_extensions[] = "EXECOMBAT", *walk;

for (walk = exe_extensions; *walk; walk += 3)
if (!strncmp(extension, walk, 3))
Expand Down

0 comments on commit ef19470

Please sign in to comment.