aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorDanny Kukawka <danny.kukawka@bisect.de>2012-02-14 09:35:03 -0500
committerGrant Likely <grant.likely@secretlab.ca>2012-03-09 16:43:12 -0500
commitde3bd7e6de25141c466773c2e0fa319b2fa93655 (patch)
tree684104e835c605ae49cc2b9acbf2649906e7bd00 /drivers/spi
parent690fb11be34cc908ef895d16c6c1673df1b4667a (diff)
spi-topcliff-pch: fix -Wuninitialized warning
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 Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-topcliff-pch.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index 2a6429d8c363..88e6b3fd1f12 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -318,22 +318,23 @@ static void pch_spi_handler_sub(struct pch_spi_data *data, u32 reg_spsr_val,
318 data->tx_index = tx_index; 318 data->tx_index = tx_index;
319 data->rx_index = rx_index; 319 data->rx_index = rx_index;
320 320
321 } 321 /* if transfer complete interrupt */
322 322 if (reg_spsr_val & SPSR_FI_BIT) {
323 /* if transfer complete interrupt */ 323 if ((tx_index == bpw_len) && (rx_index == tx_index)) {
324 if (reg_spsr_val & SPSR_FI_BIT) { 324 /* disable interrupts */
325 if ((tx_index == bpw_len) && (rx_index == tx_index)) { 325 pch_spi_setclr_reg(data->master, PCH_SPCR, 0,
326 /* disable interrupts */ 326 PCH_ALL);
327 pch_spi_setclr_reg(data->master, PCH_SPCR, 0, PCH_ALL); 327
328 328 /* transfer is completed;
329 /* transfer is completed; 329 inform pch_spi_process_messages */
330 inform pch_spi_process_messages */ 330 data->transfer_complete = true;
331 data->transfer_complete = true; 331 data->transfer_active = false;
332 data->transfer_active = false; 332 wake_up(&data->wait);
333 wake_up(&data->wait); 333 } else {
334 } else { 334 dev_err(&data->master->dev,
335 dev_err(&data->master->dev, 335 "%s : Transfer is not completed",
336 "%s : Transfer is not completed", __func__); 336 __func__);
337 }
337 } 338 }
338 } 339 }
339} 340}