All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Huang\, Ying" <ying.huang@intel.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux-Next Mailing List <linux-next@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	Huang Ying <ying.huang@intel.com>
Subject: Re: linux-next: build warning after merge of the akpm tree
Date: Tue, 01 Aug 2017 14:15:29 +0800	[thread overview]
Message-ID: <87bmnzizjy.fsf@yhuang-dev.intel.com> (raw)
In-Reply-To: <20170801160257.0b1306b2@canb.auug.org.au> (Stephen Rothwell's message of "Tue, 1 Aug 2017 16:02:57 +1000")

Hi, Stephen,

Thanks for reporting.

Stephen Rothwell <sfr@canb.auug.org.au> writes:

> Hi Andrew,
>
> After merging the akpm tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
>
> mm/swapfile.c: In function 'reuse_swap_page':
> mm/swapfile.c:1429:16: warning: 'offset' may be used uninitialized in this function [-Wmaybe-uninitialized]
>   unsigned long offset;
>                 ^
>
> Introduced by commit
>
>   e16cd4930836 ("mm, THP, swap: make reuse_swap_page() works for THP swapped out")

This looks like a false positive reporting and not reported by my
compiler and kbuild compiler (gcc-6).  But anyway, we should silence it.

Best Regards,
Huang, Ying

---------->8----------
>From 7a7ff76d7bcbd7affda169b29abcf3dafa38052e Mon Sep 17 00:00:00 2001
From: Huang Ying <ying.huang@intel.com>
Date: Tue, 1 Aug 2017 14:12:21 +0800
Subject: [PATCH] mm, THP, swap: Silence a compiler warning

To fix the following compiler warning,

mm/swapfile.c: In function 'reuse_swap_page':
mm/swapfile.c:1429:16: warning: 'offset' may be used uninitialized in this function [-Wmaybe-uninitialized]
  unsigned long offset;
                ^

This is a false positive report, but we should silence it anyway.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
---
 mm/swapfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 32434541cc12..64a94f70e867 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1426,7 +1426,7 @@ static int page_trans_huge_map_swapcount(struct page *page, int *total_mapcount,
 					 int *total_swapcount)
 {
 	int i, map_swapcount, _total_mapcount, _total_swapcount;
-	unsigned long offset;
+	unsigned long offset = 0;
 	struct swap_info_struct *si;
 	struct swap_cluster_info *ci = NULL;
 	unsigned char *map = NULL;
-- 
2.13.2

  reply	other threads:[~2017-08-01  6:15 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-01  6:02 linux-next: build warning after merge of the akpm tree Stephen Rothwell
2017-08-01  6:15 ` Huang, Ying [this message]
2017-08-01 21:15   ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2021-01-28  8:46 Stephen Rothwell
2021-02-01  7:14 ` Vijayanand Jitta
2020-12-04 10:00 Stephen Rothwell
2020-12-05  5:19 ` Andrew Morton
2020-12-05  9:37   ` Stephen Rothwell
2020-12-07 12:08   ` Dmitry Vyukov
2020-12-07 12:38     ` Dmitry Vyukov
2020-12-07 12:52       ` Marco Elver
2020-12-09 10:06         ` Dmitry Vyukov
2020-12-08 12:01 ` Stephen Rothwell
2020-12-08 12:01   ` Stephen Rothwell
2020-12-09  4:44   ` Michael Ellerman
2020-12-09  4:44     ` Michael Ellerman
2020-12-09  7:07     ` Stephen Rothwell
2020-12-09  7:07       ` Stephen Rothwell
2020-12-10  0:19       ` Michael Ellerman
2020-12-10  0:19         ` Michael Ellerman
2020-12-10 21:17         ` Stephen Rothwell
2020-12-10 21:17           ` Stephen Rothwell
2020-12-09 10:33   ` Stephen Rothwell
2020-12-09 10:33     ` Stephen Rothwell
2020-12-09 18:56   ` Kees Cook
2020-12-09 18:56     ` Kees Cook
2020-02-28  4:35 Stephen Rothwell
2020-02-28  5:23 ` Arjun Roy
2020-01-06  6:11 Stephen Rothwell
2020-01-06  6:07 Stephen Rothwell
2020-01-07 23:11 ` Andrew Morton
2020-01-08 14:52   ` Steven Price
2018-11-30  5:40 Stephen Rothwell
2018-11-30 14:52 ` Dave Rodgman
2017-06-26  6:30 Stephen Rothwell
2017-06-26 23:57 ` Wei Yang
2014-05-19  8:13 Stephen Rothwell
2014-05-19 15:13 ` Davidlohr Bueso
2014-05-19 19:48   ` Andrew Morton
2014-05-19 20:56     ` Davidlohr Bueso
2014-05-19 21:17       ` Andrew Morton
2014-05-19 21:36   ` Stephen Rothwell
2014-05-19 22:38     ` Davidlohr Bueso
2013-04-18  8:03 Stephen Rothwell
2013-04-10  8:33 Stephen Rothwell
2013-04-10  8:18 Stephen Rothwell
2013-02-20  6:34 Stephen Rothwell
2013-02-20 14:37 ` Peter Jones
2013-01-23  6:33 Stephen Rothwell
2013-01-23  6:43 ` Tang Chen
2012-11-09  3:43 Stephen Rothwell
2012-11-09 10:00 ` Grant Likely
2012-10-25  3:35 Stephen Rothwell
2012-04-27  5:44 Stephen Rothwell
2012-04-27  6:22 ` Cyrill Gorcunov
2012-04-27  6:28   ` Stephen Rothwell
2012-04-27  6:40     ` Cyrill Gorcunov
2011-08-10  2:13 Stephen Rothwell

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=87bmnzizjy.fsf@yhuang-dev.intel.com \
    --to=ying.huang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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.