Re: [PATCH] gpio: bd70528: remove unneeded break

From: Vaittinen, Matti
Date: Tue Oct 20 2020 - 06:08:07 EST


Thanks Tom,

On Mon, 2020-10-19 at 12:33 -0700, trix@xxxxxxxxxx wrote:
> From: Tom Rix <trix@xxxxxxxxxx>
>
> A break is not needed if it is preceded by a return
>
> Signed-off-by: Tom Rix <trix@xxxxxxxxxx>
> ---
> drivers/gpio/gpio-bd70528.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-bd70528.c b/drivers/gpio/gpio-
> bd70528.c
> index 45b3da8da336..931e5765fe92 100644
> --- a/drivers/gpio/gpio-bd70528.c
> +++ b/drivers/gpio/gpio-bd70528.c
> @@ -71,17 +71,14 @@ static int bd70528_gpio_set_config(struct
> gpio_chip *chip, unsigned int offset,
> GPIO_OUT_REG(offset),
> BD70528_GPIO_DRIVE_MASK,
> BD70528_GPIO_OPEN_DRAIN);
> - break;
My personal taste is also to omit these breaks but I am pretty sure I
saw some tooling issuing a warning about falling through the switch-
case back when I wrote this. Most probably checkpatch didn't like that
back then. Anyways - if you have no warnings from any of the tools -
this indeed looks better (to me) without the break :)

> case PIN_CONFIG_DRIVE_PUSH_PULL:
> return regmap_update_bits(bdgpio->chip.regmap,
> GPIO_OUT_REG(offset),
> BD70528_GPIO_DRIVE_MASK,
> BD70528_GPIO_PUSH_PULL);
> - break;
> case PIN_CONFIG_INPUT_DEBOUNCE:
> return bd70528_set_debounce(bdgpio, offset,
> pinconf_to_config_argument(
> config));
> - break;
> default:

Actually - my personal taste would be to also get rid of the empty
default here - but I guess it was also added to make some tool happy...

> break;
> }

Acked-by: Matti Vaittinen <matti.vaittinen@xxxxxxxxxxxxxxxxx>