diff mbox series

memstick: Remove useless else branch

Message ID 20210313173740.GA580681@joeylaptop
State New
Headers show
Series memstick: Remove useless else branch | expand

Commit Message

Joey Pabalan March 13, 2021, 5:37 p.m. UTC
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(-)

Comments

Ulf Hansson March 19, 2021, 2:12 p.m. UTC | #1
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

>
diff mbox series

Patch

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,