From: Jay Fang Date: Mon, 10 May 2021 06:58:21 +0000 (+0800) Subject: spi: omap-100k: Clean the value of 'status' is not used X-Git-Tag: v5.14-rc1~187^2^2~48^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=856a9260e17129303102a7d4a5f71b7a8739e5b9;p=thirdparty%2Fkernel%2Flinux.git spi: omap-100k: Clean the value of 'status' is not used An error code is set to 'status' before exiting list_for_each_entry() loop, but the value of 'status' is not used as below: list_for_each_entry(t, &m->transfers, transfer_list) { if (t->tx_buf == NULL && t->rx_buf == NULL && t->len) { status = -EINVAL; break; } ... } status = omap1_spi100k_setup_transfer(spi, NULL); Signed-off-by: Jay Fang Link: https://lore.kernel.org/r/1620629903-15493-3-git-send-email-f.fangjian@huawei.com Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c index 7062f29022539..dc9b86b648ac0 100644 --- a/drivers/spi/spi-omap-100k.c +++ b/drivers/spi/spi-omap-100k.c @@ -296,7 +296,6 @@ static int omap1_spi100k_transfer_one_message(struct spi_master *master, list_for_each_entry(t, &m->transfers, transfer_list) { if (t->tx_buf == NULL && t->rx_buf == NULL && t->len) { - status = -EINVAL; break; } status = omap1_spi100k_setup_transfer(spi, t); @@ -315,7 +314,6 @@ static int omap1_spi100k_transfer_one_message(struct spi_master *master, m->actual_length += count; if (count != t->len) { - status = -EIO; break; } }