linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Vaittinen, Matti" <Matti.Vaittinen@fi.rohmeurope.com>
To: "bgolaszewski@baylibre.com" <bgolaszewski@baylibre.com>,
	"trix@redhat.com" <trix@redhat.com>,
	"linus.walleij@linaro.org" <linus.walleij@linaro.org>
Cc: linux-power <linux-power@fi.rohmeurope.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpio: bd70528: remove unneeded break
Date: Tue, 20 Oct 2020 10:08:00 +0000	[thread overview]
Message-ID: <5b13773306265f89366b86afba71d2b4a4130e2b.camel@fi.rohmeurope.com> (raw)
In-Reply-To: <20201019193353.13066-1-trix@redhat.com>

Thanks Tom,

On Mon, 2020-10-19 at 12:33 -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.com>
> 
> A break is not needed if it is preceded by a return
> 
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  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@fi.rohmeurope.com>


  reply	other threads:[~2020-10-20 10:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 19:33 [PATCH] gpio: bd70528: remove unneeded break trix
2020-10-20 10:08 ` Vaittinen, Matti [this message]
2020-10-20 11:46   ` Andy Shevchenko
2020-10-20 11:50     ` Vaittinen, Matti
2020-10-20 11:48   ` Vaittinen, Matti
2020-10-20 18:36     ` Joe Perches
2020-10-21  7:25       ` Vaittinen, Matti
2020-10-21 14:39         ` Joe Perches
2020-10-22  9:23           ` Vaittinen, Matti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b13773306265f89366b86afba71d2b4a4130e2b.camel@fi.rohmeurope.com \
    --to=matti.vaittinen@fi.rohmeurope.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-power@fi.rohmeurope.com \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).