mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: "Manuel Schölling" <manuel.schoelling@gmx.de>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] fs: FAT: Cleanup string initializations (char[] instead of char *)
Date: Sun, 18 May 2014 00:45:20 +0900	[thread overview]
Message-ID: <878uq0l88f.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <1400339665-22321-1-git-send-email-manuel.schoelling@gmx.de> ("Manuel =?iso-8859-1?Q?Sch=F6lling=22's?= message of "Sat, 17 May 2014 17:14:25 +0200")

Manuel Schölling <manuel.schoelling@gmx.de> writes:

> 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>

Looks good.

Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

> ---
>  fs/fat/inode.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> index b3361fe..8b7d00e 100644
> --- a/fs/fat/inode.c
> +++ b/fs/fat/inode.c
> @@ -359,7 +359,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))

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

      reply	other threads:[~2014-05-17 15:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-17 15:14 Manuel Schölling
2014-05-17 15:45 ` OGAWA Hirofumi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878uq0l88f.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manuel.schoelling@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®