The patch titled Subject: nvdimm: avoid bogus -Wmaybe-uninitialized warning has been added to the -mm tree. Its filename is nvdimm-avoid-bogus-wmaybe-uninitialized-warning.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/nvdimm-avoid-bogus-wmaybe-uninitialized-warning.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/nvdimm-avoid-bogus-wmaybe-uninitialized-warning.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Arnd Bergmann <arnd@xxxxxxxx> Subject: nvdimm: avoid bogus -Wmaybe-uninitialized warning Removing the btt_rw_page/pmem_rw_page functions has a surprising side-effect of introducing a false-positive warning in another function, due to changed inlining decisions in gcc: In file included from drivers/nvdimm/pmem.c:36:0: drivers/nvdimm/pmem.c: In function 'pmem_make_request': drivers/nvdimm/nd.h:407:2: error: 'start' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/nvdimm/pmem.c:174:16: note: 'start' was declared here In file included from drivers/nvdimm/btt.c:27:0: drivers/nvdimm/btt.c: In function 'btt_make_request': drivers/nvdimm/nd.h:407:2: error: 'start' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/nvdimm/btt.c:1202:16: note: 'start' was declared here The problem is that gcc fails to track the value of the 'do_acct' variable here and has to read it back from stack, but it does remember that 'start' may be uninitialized sometimes. This shuts up the warning by making nd_iostat_start() always initialize the 'start' variable. In those cases that gcc successfully tracks the state of the variable, this will have no effect. Link: http://lkml.kernel.org/r/20170801114926.1171418-1-arnd@xxxxxxxx Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx> Cc: Dan Williams <dan.j.williams@xxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx> Cc: Vishal Verma <vishal.l.verma@xxxxxxxxx> Cc: Toshi Kani <toshi.kani@xxxxxxx> Cc: Johannes Thumshirn <jthumshirn@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/nvdimm/nd.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -puN drivers/nvdimm/nd.h~nvdimm-avoid-bogus-wmaybe-uninitialized-warning drivers/nvdimm/nd.h --- a/drivers/nvdimm/nd.h~nvdimm-avoid-bogus-wmaybe-uninitialized-warning +++ a/drivers/nvdimm/nd.h @@ -392,8 +392,10 @@ static inline bool nd_iostat_start(struc { struct gendisk *disk = bio->bi_bdev->bd_disk; - if (!blk_queue_io_stat(disk->queue)) + if (!blk_queue_io_stat(disk->queue)) { + *start = 0; return false; + } *start = jiffies; generic_start_io_acct(bio_data_dir(bio), _ Patches currently in -mm which might be from arnd@xxxxxxxx are kasan-avoid-wmaybe-uninitialized-warning-v3.patch adfs-use-unsigned-types-for-memcpy-length.patch nvdimm-avoid-bogus-wmaybe-uninitialized-warning.patch fscache-fix-fscache_objlist_show-format-processing.patch ib-mlx4-fix-sprintf-format-warning.patch iopoll-avoid-wint-in-bool-context-warning.patch kbuild-use-fshort-wchar-globally.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html