• Danny Kukawka's avatar
    spi-topcliff-pch: fix -Wuninitialized warning · 6123fa90
    Danny Kukawka authored
    commit de3bd7e6 upstream.
    
    Fix for:
    drivers/spi/spi-topcliff-pch.c: In function ‘pch_spi_handler_sub’:
    drivers/spi/spi-topcliff-pch.c:325:17: warning: ‘bpw_len’ may be
      used uninitialized in this function [-Wuninitialized]
    drivers/spi/spi-topcliff-pch.c:325:42: warning: ‘rx_index’ may be
      used uninitialized in this function [-Wuninitialized]
    drivers/spi/spi-topcliff-pch.c:325:42: warning: ‘tx_index’ may be
      used uninitialized in this function [-Wuninitialized]
    
    Move usage of tx_index, rx_index and bpw_len into the same
    block as where they are set to prevent uninitialized usage.
    
    v2: instead of init variables with 0 move the whole block
    
    [This patch title "warnings" makes you think "This patch is not
    for bug fix".  However, this patch surely patch for bug fix.]
    Signed-off-by: default avatarDanny Kukawka <danny.kukawka@bisect.de>
    Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
    Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    6123fa90
spi-topcliff-pch.c 46.5 KB