Patch "regmap: maple: work around gcc-14.1 false-positive warning" has been added to the 6.6-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    regmap: maple: work around gcc-14.1 false-positive warning

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     regmap-maple-work-around-gcc-14.1-false-positive-war.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d094b75c149a97479a9925ce20f57bbca4d8b1a6
Author: Arnd Bergmann <arnd@xxxxxxxx>
Date:   Fri Jul 19 12:40:24 2024 +0200

    regmap: maple: work around gcc-14.1 false-positive warning
    
    [ Upstream commit 542440fd7b30983cae23e32bd22f69a076ec7ef4 ]
    
    With gcc-14.1, there is a false-postive -Wuninitialized warning in
    regcache_maple_drop:
    
    drivers/base/regmap/regcache-maple.c: In function 'regcache_maple_drop':
    drivers/base/regmap/regcache-maple.c:113:23: error: 'lower_index' is used uninitialized [-Werror=uninitialized]
      113 |         unsigned long lower_index, lower_last;
          |                       ^~~~~~~~~~~
    drivers/base/regmap/regcache-maple.c:113:36: error: 'lower_last' is used uninitialized [-Werror=uninitialized]
      113 |         unsigned long lower_index, lower_last;
          |                                    ^~~~~~~~~~
    
    I've created a reduced test case to see if this needs to be reported
    as a gcc, but it appears that the gcc-14.x branch already has a change
    that turns this into a more sensible -Wmaybe-uninitialized warning, so
    I ended up not reporting it so far.
    
    The reduced test case also produces a warning for gcc-13 and gcc-12
    but I don't see that with the version in the kernel.
    
    Link: https://godbolt.org/z/oKbohKqd3
    Link: https://lore.kernel.org/all/CAMuHMdWj=FLmkazPbYKPevDrcym2_HDb_U7Mb9YE9ovrP0jJfA@xxxxxxxxxxxxxx/
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Link: https://patch.msgid.link/20240719104030.1382465-1-arnd@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/base/regmap/regcache-maple.c b/drivers/base/regmap/regcache-maple.c
index 55999a50ccc0..0b6c2277128b 100644
--- a/drivers/base/regmap/regcache-maple.c
+++ b/drivers/base/regmap/regcache-maple.c
@@ -110,7 +110,8 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min,
 	struct maple_tree *mt = map->cache;
 	MA_STATE(mas, mt, min, max);
 	unsigned long *entry, *lower, *upper;
-	unsigned long lower_index, lower_last;
+	/* initialized to work around false-positive -Wuninitialized warning */
+	unsigned long lower_index = 0, lower_last = 0;
 	unsigned long upper_index, upper_last;
 	int ret = 0;
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux