[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <542A5B5B.7060207@suse.cz>
Date: Tue, 30 Sep 2014 09:27:23 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Xiubo Li <Li.Xiubo@...escale.com>, akpm@...ux-foundation.org,
linux-mm@...ck.org
CC: linux-kernel@...r.kernel.org, mgorman@...e.de, rientjes@...gle.com,
minchan@...nel.org
Subject: Re: [PATCH] mm, compaction: using uninitialized_var insteads setting
'flags' to 0 directly.
On 09/29/2014 05:30 AM, Xiubo Li wrote:
> Setting 'flags' to zero will be certainly a misleading way to avoid
> warning of 'flags' may be used uninitialized. uninitialized_var is
> a correct way because the warning is a false possitive.
Agree.
> Signed-off-by: Xiubo Li <Li.Xiubo@...escale.com>
Acked-by: Vlastimil Babka <vbabka@...e.cz>
> ---
> mm/compaction.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 92075d5..59a116d 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -344,7 +344,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
> {
> int nr_scanned = 0, total_isolated = 0;
> struct page *cursor, *valid_page = NULL;
> - unsigned long flags = 0;
> + unsigned long uninitialized_var(flags);
> bool locked = false;
> unsigned long blockpfn = *start_pfn;
>
> @@ -573,7 +573,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
> unsigned long nr_scanned = 0, nr_isolated = 0;
> struct list_head *migratelist = &cc->migratepages;
> struct lruvec *lruvec;
> - unsigned long flags = 0;
> + unsigned long uninitialized_var(flags);
> bool locked = false;
> struct page *page = NULL, *valid_page = NULL;
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists