* [PATCH] mmc: vub300: remove unreachable return value handling
@ 2015-01-18 1:51 Nicholas Mc Guire
2015-01-21 11:36 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Mc Guire @ 2015-01-18 1:51 UTC (permalink / raw)
To: Tony Olech
Cc: Chris Ball, Ulf Hansson, linux-mmc, linux-usb, linux-kernel,
Nicholas Mc Guire
Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---
The return value of wait_for_completion_timeout is unsigned long,
as it is used here for wait_for_completion_timeout only the type
of commretval was changed to unsigned long.
As wait_for_completion_timeout does not return negative values
the commretval < 0 case is not reachable and can be removed.
This was only compile-tested for x86_64_defconfig + CONFIG_MMC=m,
CONFIG_MMC_VUB300=m
Patch is against 3.19.0-rc4 -next-20150116
drivers/mmc/host/vub300.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index 4262296..fbabbb8 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -659,7 +659,7 @@ static void __vub300_irqpoll_response(struct vub300_mmc_host *vub300)
static void __do_poll(struct vub300_mmc_host *vub300)
{
/* cmd_mutex is held by vub300_pollwork_thread */
- long commretval;
+ unsigned long commretval;
mod_timer(&vub300->inactivity_timer, jiffies + HZ);
init_completion(&vub300->irqpoll_complete);
send_irqpoll(vub300);
@@ -671,8 +671,6 @@ static void __do_poll(struct vub300_mmc_host *vub300)
vub300->usb_timed_out = 1;
usb_kill_urb(vub300->command_out_urb);
usb_kill_urb(vub300->command_res_urb);
- } else if (commretval < 0) {
- vub300_queue_poll_work(vub300, 1);
} else { /* commretval > 0 */
__vub300_irqpoll_response(vub300);
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mmc: vub300: remove unreachable return value handling
2015-01-18 1:51 [PATCH] mmc: vub300: remove unreachable return value handling Nicholas Mc Guire
@ 2015-01-21 11:36 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2015-01-21 11:36 UTC (permalink / raw)
To: Nicholas Mc Guire
Cc: Tony Olech, Chris Ball, linux-mmc, linux-usb, linux-kernel
On 18 January 2015 at 02:51, Nicholas Mc Guire <der.herr@hofr.at> wrote:
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Thanks! Applied for next.
Kind regards
Uffe
> ---
>
> The return value of wait_for_completion_timeout is unsigned long,
> as it is used here for wait_for_completion_timeout only the type
> of commretval was changed to unsigned long.
>
> As wait_for_completion_timeout does not return negative values
> the commretval < 0 case is not reachable and can be removed.
>
> This was only compile-tested for x86_64_defconfig + CONFIG_MMC=m,
> CONFIG_MMC_VUB300=m
>
> Patch is against 3.19.0-rc4 -next-20150116
>
> drivers/mmc/host/vub300.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
> index 4262296..fbabbb8 100644
> --- a/drivers/mmc/host/vub300.c
> +++ b/drivers/mmc/host/vub300.c
> @@ -659,7 +659,7 @@ static void __vub300_irqpoll_response(struct vub300_mmc_host *vub300)
> static void __do_poll(struct vub300_mmc_host *vub300)
> {
> /* cmd_mutex is held by vub300_pollwork_thread */
> - long commretval;
> + unsigned long commretval;
> mod_timer(&vub300->inactivity_timer, jiffies + HZ);
> init_completion(&vub300->irqpoll_complete);
> send_irqpoll(vub300);
> @@ -671,8 +671,6 @@ static void __do_poll(struct vub300_mmc_host *vub300)
> vub300->usb_timed_out = 1;
> usb_kill_urb(vub300->command_out_urb);
> usb_kill_urb(vub300->command_res_urb);
> - } else if (commretval < 0) {
> - vub300_queue_poll_work(vub300, 1);
> } else { /* commretval > 0 */
> __vub300_irqpoll_response(vub300);
> }
> --
> 1.7.10.4
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-21 11:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-18 1:51 [PATCH] mmc: vub300: remove unreachable return value handling Nicholas Mc Guire
2015-01-21 11:36 ` Ulf Hansson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.