LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net] staging: Remove set but not used variable ‘status’
@ 2019-05-25  4:26 Mao Wenan
  2019-05-25  5:01 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Mao Wenan @ 2019-05-25  4:26 UTC (permalink / raw)
  To: gregkh, jeremy; +Cc: devel, linux-kernel, kernel-janitors, Mao Wenan

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/kpc2000/kpc_spi/spi_driver.c: In function
‘kp_spi_transfer_one_message’:
drivers/staging/kpc2000/kpc_spi/spi_driver.c:282:9: warning: variable
‘status’ set but not used [-Wunused-but-set-variable]
     int status = 0;
         ^~~~~~
The variable 'status' is not used any more, remve it.

Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
 drivers/staging/kpc2000/kpc_spi/spi_driver.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/kpc2000/kpc_spi/spi_driver.c b/drivers/staging/kpc2000/kpc_spi/spi_driver.c
index 86df16547a92..16f9518f8d63 100644
--- a/drivers/staging/kpc2000/kpc_spi/spi_driver.c
+++ b/drivers/staging/kpc2000/kpc_spi/spi_driver.c
@@ -279,7 +279,6 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m)
     struct kp_spi       *kpspi;
     struct spi_transfer *transfer;
     union kp_spi_config sc;
-    int status = 0;
     
     spidev = m->spi;
     kpspi = spi_master_get_devdata(master);
@@ -332,7 +331,6 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m)
     /* do the transfers for this message */
     list_for_each_entry(transfer, &m->transfers, transfer_list) {
         if (transfer->tx_buf == NULL && transfer->rx_buf == NULL && transfer->len) {
-            status = -EINVAL;
             break;
         }
         
@@ -370,7 +368,6 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m)
             m->actual_length += count;
             
             if (count != transfer->len) {
-                status = -EIO;
                 break;
             }
         }
-- 
2.20.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-05-28  7:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-25  4:26 [PATCH net] staging: Remove set but not used variable ‘status’ Mao Wenan
2019-05-25  5:01 ` Greg KH
2019-05-25  6:39   ` maowenan
2019-05-25  8:13 ` [PATCH -next v2] staging: kpc2000: " Mao Wenan
2019-05-28  2:09   ` maowenan
2019-05-28  8:02   ` [PATCH -next v3 0/2] cleanup for kpc2000_spi.c Mao Wenan
2019-05-28  8:02     ` [PATCH -next v3 1/2] staging: kpc2000: report error status to spi core Mao Wenan
2019-05-28  8:02     ` [PATCH -next v3 2/2] staging: kpc2000: replace white spaces with tabs for kpc2000_spi.c Mao Wenan
2019-05-25 12:59 ` [PATCH net] staging: Remove set but not used variable ‘status’ Sven Van Asbroeck
2019-05-27  2:33   ` maowenan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).