Patch "MIPS: dec: prom: Address -Warray-bounds warning" has been added to the 4.19-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

    MIPS: dec: prom: Address -Warray-bounds warning

to the 4.19-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:
     mips-dec-prom-address-warray-bounds-warning.patch
and it can be found in the queue-4.19 subdirectory.

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



commit ccf3d6017197970c2a17a3d970844de937b2e5cb
Author: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>
Date:   Thu Jun 22 17:43:57 2023 -0600

    MIPS: dec: prom: Address -Warray-bounds warning
    
    [ Upstream commit 7b191b9b55df2a844bd32d1d380f47a7df1c2896 ]
    
    Zero-length arrays are deprecated, and we are replacing them with flexible
    array members instead. So, replace zero-length array with flexible-array
    member in struct memmap.
    
    Address the following warning found after building (with GCC-13) mips64
    with decstation_64_defconfig:
    In function 'rex_setup_memory_region',
        inlined from 'prom_meminit' at arch/mips/dec/prom/memory.c:91:3:
    arch/mips/dec/prom/memory.c:72:31: error: array subscript i is outside array bounds of 'unsigned char[0]' [-Werror=array-bounds=]
       72 |                 if (bm->bitmap[i] == 0xff)
          |                     ~~~~~~~~~~^~~
    In file included from arch/mips/dec/prom/memory.c:16:
    ./arch/mips/include/asm/dec/prom.h: In function 'prom_meminit':
    ./arch/mips/include/asm/dec/prom.h:73:23: note: while referencing 'bitmap'
       73 |         unsigned char bitmap[0];
    
    This helps with the ongoing efforts to globally enable -Warray-bounds.
    
    This results in no differences in binary output.
    
    Link: https://github.com/KSPP/linux/issues/79
    Link: https://github.com/KSPP/linux/issues/323
    Signed-off-by: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>
    Signed-off-by: Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/mips/include/asm/dec/prom.h b/arch/mips/include/asm/dec/prom.h
index 09538ff5e9245..6f0405ba27d6d 100644
--- a/arch/mips/include/asm/dec/prom.h
+++ b/arch/mips/include/asm/dec/prom.h
@@ -74,7 +74,7 @@ static inline bool prom_is_rex(u32 magic)
  */
 typedef struct {
 	int pagesize;
-	unsigned char bitmap[0];
+	unsigned char bitmap[];
 } memmap;
 
 



[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