Re: linux-next: build warning after merge of the md tree

From: Ming Lei
Date: Tue Mar 28 2017 - 04:18:53 EST


Hi,

On Tue, Mar 28, 2017 at 03:40:22PM +1100, Stephen Rothwell wrote:
> Hi Shaohua,
>
> After merging the md tree, today's linux-next build (powerpc
> pseries_le_defconfig) produced this warning:
>
> drivers/md/raid1.c: In function 'raid1d':
> drivers/md/raid1.c:2172:9: warning: 'page_len$' may be used uninitialized in this function [-Wmaybe-uninitialized]
> if (memcmp(page_address(ppages[j]),
> ^
> drivers/md/raid1.c:2160:7: note: 'page_len$' was declared here
> int page_len[RESYNC_PAGES];
> ^
>
> Introduced by commit
>
> 60928a91b0b3 ("md: raid1: use bio helper in process_checks()")

It is a false positive, and looks we have to initialize it for killing
the warning since I don't find a annotation for addressing uninitialized
array.

So how about the following patch?

---