All of lore.kernel.org
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Borislav Petkov <bp@alien8.de>,
	lkml <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, kosaki.motohiro@gmail.com
Subject: Re: [PATCH] ipc/shm.c: don't use auto variable hs in newseg()
Date: Fri, 17 May 2013 16:31:52 -0400	[thread overview]
Message-ID: <519693B8.10600@gmail.com> (raw)
In-Reply-To: <1368046093-mpzcumyb-mutt-n-horiguchi@ah.jp.nec.com>

> From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Date: Wed, 8 May 2013 11:48:01 -0400
> Subject: [PATCH] ipc/shm.c: don't use auto variable hs in newseg()
> 
> This patch fixes "warning: unused variable 'hs'" when !CONFIG_HUGETLB_PAGE
> introduced by commit af73e4d9506d "hugetlbfs: fix mmap failure in unaligned
> size request".
> 
> Reported-by: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> ---
>  ipc/shm.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/ipc/shm.c b/ipc/shm.c
> index e316cb9..9ff741a 100644
> --- a/ipc/shm.c
> +++ b/ipc/shm.c
> @@ -491,9 +491,8 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
>  
>  	sprintf (name, "SYSV%08x", key);
>  	if (shmflg & SHM_HUGETLB) {
> -		struct hstate *hs = hstate_sizelog((shmflg >> SHM_HUGE_SHIFT)
> -						& SHM_HUGE_MASK);
> -		size_t hugesize = ALIGN(size, huge_page_size(hs));
> +		size_t hugesize = ALIGN(size, huge_page_size(hstate_sizelog(
> +				(shmflg >> SHM_HUGE_SHIFT) & SHM_HUGE_MASK)));

NAK. This is uglier than before.
You should change !CONFIG_HUGETLB_PAGE specific code instead.






--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Borislav Petkov <bp@alien8.de>,
	lkml <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, kosaki.motohiro@gmail.com
Subject: Re: [PATCH] ipc/shm.c: don't use auto variable hs in newseg()
Date: Fri, 17 May 2013 16:31:52 -0400	[thread overview]
Message-ID: <519693B8.10600@gmail.com> (raw)
In-Reply-To: <1368046093-mpzcumyb-mutt-n-horiguchi@ah.jp.nec.com>

> From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Date: Wed, 8 May 2013 11:48:01 -0400
> Subject: [PATCH] ipc/shm.c: don't use auto variable hs in newseg()
> 
> This patch fixes "warning: unused variable 'hs'" when !CONFIG_HUGETLB_PAGE
> introduced by commit af73e4d9506d "hugetlbfs: fix mmap failure in unaligned
> size request".
> 
> Reported-by: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> ---
>  ipc/shm.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/ipc/shm.c b/ipc/shm.c
> index e316cb9..9ff741a 100644
> --- a/ipc/shm.c
> +++ b/ipc/shm.c
> @@ -491,9 +491,8 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
>  
>  	sprintf (name, "SYSV%08x", key);
>  	if (shmflg & SHM_HUGETLB) {
> -		struct hstate *hs = hstate_sizelog((shmflg >> SHM_HUGE_SHIFT)
> -						& SHM_HUGE_MASK);
> -		size_t hugesize = ALIGN(size, huge_page_size(hs));
> +		size_t hugesize = ALIGN(size, huge_page_size(hstate_sizelog(
> +				(shmflg >> SHM_HUGE_SHIFT) & SHM_HUGE_MASK)));

NAK. This is uglier than before.
You should change !CONFIG_HUGETLB_PAGE specific code instead.







  reply	other threads:[~2013-05-17 20:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-08 14:34 ipc/shm.c:494:18: warning: unused variable ‘hs’ [-Wunused-variable] Borislav Petkov
2013-05-08 16:12 ` Naoya Horiguchi
2013-05-08 18:45   ` Borislav Petkov
2013-05-08 20:48     ` [PATCH] ipc/shm.c: don't use auto variable hs in newseg() Naoya Horiguchi
2013-05-08 20:48       ` Naoya Horiguchi
2013-05-17 20:31       ` KOSAKI Motohiro [this message]
2013-05-17 20:31         ` KOSAKI Motohiro
2013-05-18  1:46         ` Naoya Horiguchi
2013-05-18  1:46           ` Naoya Horiguchi

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=519693B8.10600@gmail.com \
    --to=kosaki.motohiro@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.