public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] memstick: Remove useless else branch
@ 2021-03-13 17:37 Joey Pabalan
  2021-03-19 14:12 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Joey Pabalan @ 2021-03-13 17:37 UTC (permalink / raw)
  To: Maxim Levitsky; +Cc: linux-mmc

Remove else branch on line 334 of memstick.c, after the return of the
previous branch. Found by checkpatch.

Signed-off-by: Joey Pabalan <jpabalanb@gmail.com>
---
 drivers/memstick/core/memstick.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c
index 12bc3f5a6cbb..bb1065990aeb 100644
--- a/drivers/memstick/core/memstick.c
+++ b/drivers/memstick/core/memstick.c
@@ -331,18 +331,17 @@ static int h_memstick_read_dev_id(struct memstick_dev *card,
 				  sizeof(struct ms_id_register));
 		*mrq = &card->current_mrq;
 		return 0;
-	} else {
-		if (!(*mrq)->error) {
-			memcpy(&id_reg, (*mrq)->data, sizeof(id_reg));
-			card->id.match_flags = MEMSTICK_MATCH_ALL;
-			card->id.type = id_reg.type;
-			card->id.category = id_reg.category;
-			card->id.class = id_reg.class;
-			dev_dbg(&card->dev, "if_mode = %02x\n", id_reg.if_mode);
-		}
-		complete(&card->mrq_complete);
-		return -EAGAIN;
 	}
+	if (!(*mrq)->error) {
+		memcpy(&id_reg, (*mrq)->data, sizeof(id_reg));
+		card->id.match_flags = MEMSTICK_MATCH_ALL;
+		card->id.type = id_reg.type;
+		card->id.category = id_reg.category;
+		card->id.class = id_reg.class;
+		dev_dbg(&card->dev, "if_mode = %02x\n", id_reg.if_mode);
+	}
+	complete(&card->mrq_complete);
+	return -EAGAIN;
 }
 
 static int h_memstick_set_rw_addr(struct memstick_dev *card,
-- 
2.27.0


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

* Re: [PATCH] memstick: Remove useless else branch
  2021-03-13 17:37 [PATCH] memstick: Remove useless else branch Joey Pabalan
@ 2021-03-19 14:12 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2021-03-19 14:12 UTC (permalink / raw)
  To: Joey Pabalan; +Cc: Maxim Levitsky, linux-mmc

On Sat, 13 Mar 2021 at 18:38, Joey Pabalan <jpabalanb@gmail.com> wrote:
>
> Remove else branch on line 334 of memstick.c, after the return of the
> previous branch. Found by checkpatch.
>
> Signed-off-by: Joey Pabalan <jpabalanb@gmail.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/memstick/core/memstick.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c
> index 12bc3f5a6cbb..bb1065990aeb 100644
> --- a/drivers/memstick/core/memstick.c
> +++ b/drivers/memstick/core/memstick.c
> @@ -331,18 +331,17 @@ static int h_memstick_read_dev_id(struct memstick_dev *card,
>                                   sizeof(struct ms_id_register));
>                 *mrq = &card->current_mrq;
>                 return 0;
> -       } else {
> -               if (!(*mrq)->error) {
> -                       memcpy(&id_reg, (*mrq)->data, sizeof(id_reg));
> -                       card->id.match_flags = MEMSTICK_MATCH_ALL;
> -                       card->id.type = id_reg.type;
> -                       card->id.category = id_reg.category;
> -                       card->id.class = id_reg.class;
> -                       dev_dbg(&card->dev, "if_mode = %02x\n", id_reg.if_mode);
> -               }
> -               complete(&card->mrq_complete);
> -               return -EAGAIN;
>         }
> +       if (!(*mrq)->error) {
> +               memcpy(&id_reg, (*mrq)->data, sizeof(id_reg));
> +               card->id.match_flags = MEMSTICK_MATCH_ALL;
> +               card->id.type = id_reg.type;
> +               card->id.category = id_reg.category;
> +               card->id.class = id_reg.class;
> +               dev_dbg(&card->dev, "if_mode = %02x\n", id_reg.if_mode);
> +       }
> +       complete(&card->mrq_complete);
> +       return -EAGAIN;
>  }
>
>  static int h_memstick_set_rw_addr(struct memstick_dev *card,
> --
> 2.27.0
>

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

end of thread, other threads:[~2021-03-19 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-13 17:37 [PATCH] memstick: Remove useless else branch Joey Pabalan
2021-03-19 14:12 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox