[withdrawn] nvdimm-avoid-bogus-wmaybe-uninitialized-warning.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: nvdimm: avoid bogus -Wmaybe-uninitialized warning
has been removed from the -mm tree.  Its filename was
     nvdimm-avoid-bogus-wmaybe-uninitialized-warning.patch

This patch was dropped because it was withdrawn

------------------------------------------------------
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.

[akpm@xxxxxxxxxxxxxxxxxxxx: add comment]
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;	/* Suppress bogus warning */
 		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
fs-proc-remove-priv-argument-from-is_stack-fix.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



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux