spi-topcliff-pch: fix -Wuninitialized warning
authorDanny Kukawka <danny.kukawka@bisect.de>
Tue, 14 Feb 2012 14:35:03 +0000 (15:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Apr 2012 22:31:14 +0000 (15:31 -0700)
commit6123fa9014c1f64d3f7040fb5844dd328336e5df
tree4c8f9f39e4769c5edb86c3a18c4cd24b418b34a8
parentf0d561a39111bc7cd9975c6004512b5b924c6ff5
spi-topcliff-pch: fix -Wuninitialized warning

commit de3bd7e6de25141c466773c2e0fa319b2fa93655 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: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-topcliff-pch.c