* [PATCH] mmc: android-goldfish: remove logically dead code in goldfish_mmc_irq()
@ 2017-06-28 13:55 Gustavo A. R. Silva
2017-07-11 14:43 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-28 13:55 UTC (permalink / raw)
To: Ulf Hansson; +Cc: linux-mmc, linux-kernel, Gustavo A. R. Silva
Local variable transfer_error is assigned to a constant value and
it is never updated again.
Remove this variable and the dead code it guards.
Addresses-Coverity-ID: 1222110
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
drivers/mmc/host/android-goldfish.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/android-goldfish.c b/drivers/mmc/host/android-goldfish.c
index 5b3e1c9..63fe509 100644
--- a/drivers/mmc/host/android-goldfish.c
+++ b/drivers/mmc/host/android-goldfish.c
@@ -290,7 +290,6 @@ static irqreturn_t goldfish_mmc_irq(int irq, void *dev_id)
u16 status;
int end_command = 0;
int end_transfer = 0;
- int transfer_error = 0;
int state_changed = 0;
int cmd_timeout = 0;
@@ -322,9 +321,7 @@ static irqreturn_t goldfish_mmc_irq(int irq, void *dev_id)
if (end_command)
goldfish_mmc_cmd_done(host, host->cmd);
- if (transfer_error)
- goldfish_mmc_xfer_done(host, host->data);
- else if (end_transfer) {
+ if (end_transfer) {
host->dma_done = 1;
goldfish_mmc_end_of_data(host, host->data);
} else if (host->data != NULL) {
@@ -347,8 +344,7 @@ static irqreturn_t goldfish_mmc_irq(int irq, void *dev_id)
mmc_detect_change(host->mmc, 0);
}
- if (!end_command && !end_transfer &&
- !transfer_error && !state_changed && !cmd_timeout) {
+ if (!end_command && !end_transfer && !state_changed && !cmd_timeout) {
status = GOLDFISH_MMC_READ(host, MMC_INT_STATUS);
dev_info(mmc_dev(host->mmc),"spurious irq 0x%04x\n", status);
if (status != 0) {
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] mmc: android-goldfish: remove logically dead code in goldfish_mmc_irq()
2017-06-28 13:55 [PATCH] mmc: android-goldfish: remove logically dead code in goldfish_mmc_irq() Gustavo A. R. Silva
@ 2017-07-11 14:43 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2017-07-11 14:43 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
On 28 June 2017 at 15:55, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
> Local variable transfer_error is assigned to a constant value and
> it is never updated again.
>
> Remove this variable and the dead code it guards.
>
> Addresses-Coverity-ID: 1222110
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Thanks, applied for next!
Kind regards
Uffe
> ---
> drivers/mmc/host/android-goldfish.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/android-goldfish.c b/drivers/mmc/host/android-goldfish.c
> index 5b3e1c9..63fe509 100644
> --- a/drivers/mmc/host/android-goldfish.c
> +++ b/drivers/mmc/host/android-goldfish.c
> @@ -290,7 +290,6 @@ static irqreturn_t goldfish_mmc_irq(int irq, void *dev_id)
> u16 status;
> int end_command = 0;
> int end_transfer = 0;
> - int transfer_error = 0;
> int state_changed = 0;
> int cmd_timeout = 0;
>
> @@ -322,9 +321,7 @@ static irqreturn_t goldfish_mmc_irq(int irq, void *dev_id)
> if (end_command)
> goldfish_mmc_cmd_done(host, host->cmd);
>
> - if (transfer_error)
> - goldfish_mmc_xfer_done(host, host->data);
> - else if (end_transfer) {
> + if (end_transfer) {
> host->dma_done = 1;
> goldfish_mmc_end_of_data(host, host->data);
> } else if (host->data != NULL) {
> @@ -347,8 +344,7 @@ static irqreturn_t goldfish_mmc_irq(int irq, void *dev_id)
> mmc_detect_change(host->mmc, 0);
> }
>
> - if (!end_command && !end_transfer &&
> - !transfer_error && !state_changed && !cmd_timeout) {
> + if (!end_command && !end_transfer && !state_changed && !cmd_timeout) {
> status = GOLDFISH_MMC_READ(host, MMC_INT_STATUS);
> dev_info(mmc_dev(host->mmc),"spurious irq 0x%04x\n", status);
> if (status != 0) {
> --
> 2.5.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-11 14:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-28 13:55 [PATCH] mmc: android-goldfish: remove logically dead code in goldfish_mmc_irq() Gustavo A. R. Silva
2017-07-11 14:43 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox