From: Alex Shi <alex.shi@linux.alibaba.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, akpm@linux-foundation.org,
mgorman@techsingularity.net, tj@kernel.org, hughd@google.com,
khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com,
yang.shi@linux.alibaba.com, willy@infradead.org,
shakeelb@google.com
Subject: Re: [PATCH v4 1/9] mm/swap: fix uninitialized compiler warning
Date: Wed, 20 Nov 2019 19:42:46 +0800 [thread overview]
Message-ID: <919a5a57-1b7a-b109-491f-2b8b099390fe@linux.alibaba.com> (raw)
In-Reply-To: <20191119154138.GB382712@cmpxchg.org>
在 2019/11/19 下午11:41, Johannes Weiner 写道:
> On Tue, Nov 19, 2019 at 08:23:15PM +0800, Alex Shi wrote:
>> ../mm/swap.c: In function ‘__page_cache_release’:
>> ../mm/swap.c:67:10: warning: ‘flags’ may be used uninitialized in this
>> function [-Wmaybe-uninitialized]
>> lruvec = lock_page_lruvec_irqsave(page, pgdat, flags);
>> ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> At this point in the series, there is no lock_page_lruvec_irqsave()
> yet, so this patch is out of order. Please don't do that. It's very
> hard to review patches that depend on later changes to make sense.
>
Sorry, I will be more careful on this.
>> Signed-off-by: Alex Shi <alex.shi@linux.alibaba.com>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: linux-mm@kvack.org
>> Cc: linux-kernel@vger.kernel.org
>> ---
>> mm/swap.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/swap.c b/mm/swap.c
>> index 5341ae93861f..c36a10244d07 100644
>> --- a/mm/swap.c
>> +++ b/mm/swap.c
>> @@ -62,7 +62,7 @@ static void __page_cache_release(struct page *page)
>> if (PageLRU(page)) {
>> pg_data_t *pgdat = page_pgdat(page);
>> struct lruvec *lruvec;
>> - unsigned long flags;
>> + unsigned long flags = 0;
> Use unintialized_var() for these cases to make the intent clear.
Thanks for suggestion!
next prev parent reply other threads:[~2019-11-20 11:42 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-19 12:23 [PATCH v4 0/9] per lruvec lru_lock for memcg Alex Shi
2019-11-19 12:23 ` [PATCH v4 1/9] mm/swap: fix uninitialized compiler warning Alex Shi
2019-11-19 15:41 ` Johannes Weiner
2019-11-20 11:42 ` Alex Shi [this message]
2019-11-19 12:23 ` [PATCH v4 2/9] mm/huge_memory: " Alex Shi
2019-11-19 15:42 ` Johannes Weiner
2019-11-19 12:23 ` [PATCH v4 3/9] mm/lru: replace pgdat lru_lock with lruvec lock Alex Shi
2019-11-19 15:57 ` Matthew Wilcox
2019-11-19 16:44 ` Johannes Weiner
2019-11-20 11:50 ` Alex Shi
2019-11-19 16:04 ` Johannes Weiner
2019-11-20 11:41 ` Alex Shi
2019-11-21 22:06 ` Johannes Weiner
2019-11-22 2:36 ` Alex Shi
2019-11-22 16:16 ` Johannes Weiner
2019-11-23 0:58 ` Hugh Dickins
2019-11-24 15:19 ` Alex Shi
2019-11-25 9:26 ` Alex Shi
2019-11-25 17:27 ` Shakeel Butt
2019-11-19 16:49 ` Shakeel Butt
2019-11-19 12:23 ` [PATCH v4 4/9] mm/mlock: only change the lru_lock iff page's lruvec is different Alex Shi
2019-11-19 12:23 ` [PATCH v4 5/9] mm/swap: " Alex Shi
2019-11-19 12:23 ` [PATCH v4 6/9] mm/vmscan: " Alex Shi
2019-11-19 12:23 ` [PATCH v4 7/9] mm/pgdat: remove pgdat lru_lock Alex Shi
2019-11-19 12:23 ` [PATCH v4 8/9] mm/lru: likely enhancement Alex Shi
2019-11-19 12:23 ` [PATCH v4 9/9] mm/lru: revise the comments of lru_lock Alex Shi
2019-11-19 16:19 ` Johannes Weiner
2019-11-20 11:48 ` Alex Shi
2019-11-24 15:49 ` [PATCH v4 0/9] per lruvec lru_lock for memcg Konstantin Khlebnikov
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=919a5a57-1b7a-b109-491f-2b8b099390fe@linux.alibaba.com \
--to=alex.shi@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=daniel.m.jordan@oracle.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=khlebnikov@yandex-team.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=shakeelb@google.com \
--cc=tj@kernel.org \
--cc=willy@infradead.org \
--cc=yang.shi@linux.alibaba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).