Skip to content

Commit ef19470

Browse files
manuelstorvalds
authored andcommitted
fs/fat/inode.c: clean up string initializations (char[] instead of char *)
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 <manuel.schoelling@gmx.de> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 190a884 commit ef19470

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/fat/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ struct inode *fat_iget(struct super_block *sb, loff_t i_pos)
421421

422422
static int is_exec(unsigned char *extension)
423423
{
424-
unsigned char *exe_extensions = "EXECOMBAT", *walk;
424+
unsigned char exe_extensions[] = "EXECOMBAT", *walk;
425425

426426
for (walk = exe_extensions; *walk; walk += 3)
427427
if (!strncmp(extension, walk, 3))

0 commit comments

Comments
 (0)