• Arnd Bergmann's avatar
    dm bufio: hide bogus warning · e9bf6fcf
    Arnd Bergmann authored
    mips-gcc-5.3 warns about correct code on linux-3.18 and earlier:
    
    In file included from ../include/linux/blkdev.h:4:0,
                     from ../drivers/md/dm-bufio.h:12,
                     from ../drivers/md/dm-bufio.c:9:
    ../drivers/md/dm-bufio.c: In function 'alloc_buffer':
    ../include/linux/sched.h:1975:56: warning: 'noio_flag' may be used uninitialized in this function [-Wmaybe-uninitialized]
      current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags;
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
    ../drivers/md/dm-bufio.c:325:11: note: 'noio_flag' was declared here
    
    The warning disappeared on later kernels with this commit: be0c37c9
    ("MIPS: Rearrange PTE bits into fixed positions.")  I assume this only
    happened because it changed some inlining decisions.
    
    On 3.18.y, we can shut up the warning by adding an extra initialization.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    e9bf6fcf
dm-bufio.c 44.7 KB