From: Jean Delvare <jdelvare@suse.de>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: Mark expected switch fall-throughs
Date: Tue, 3 Jul 2018 09:51:18 +0200 [thread overview]
Message-ID: <20180703095118.5f08abd6@endymion> (raw)
In-Reply-To: <20180702213017.GA27242@embeddedor.com>
Hi Gustavo,
On Mon, 2 Jul 2018 16:30:17 -0500, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
That's a great initiative, thanks for doing that.
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> drivers/hwmon/emc1403.c | 2 ++
> drivers/hwmon/nct6775.c | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/emc1403.c b/drivers/hwmon/emc1403.c
> index 1ea7ca5..aaebeb7 100644
> --- a/drivers/hwmon/emc1403.c
> +++ b/drivers/hwmon/emc1403.c
> @@ -443,8 +443,10 @@ static int emc1403_probe(struct i2c_client *client,
> switch (id->driver_data) {
> case emc1404:
> data->groups[2] = &emc1404_group;
> + /* fall through */
> case emc1403:
> data->groups[1] = &emc1403_group;
> + /* fall through */
> case emc1402:
> data->groups[0] = &emc1402_group;
> }
> diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
> index 3714990..c6bd61e 100644
> --- a/drivers/hwmon/nct6775.c
> +++ b/drivers/hwmon/nct6775.c
> @@ -2541,7 +2541,7 @@ static void pwm_update_registers(struct nct6775_data *data, int nr)
> case thermal_cruise:
> nct6775_write_value(data, data->REG_TARGET[nr],
> data->target_temp[nr]);
> - /* intentional */
> + /* fall through */
Do you know which -Wimplicit-fallthrough level we will be using? Level
1 would be happy with the initial comment, no change would be needed.
If level 2-4 then yes the change is needed.
> default:
> reg = nct6775_read_value(data, data->REG_FAN_MODE[nr]);
> reg = (reg & ~data->tolerance_mask) |
Reviewed-by: Jean Delvare <jdelvare@suse.de>
--
Jean Delvare
SUSE L3 Support
next prev parent reply other threads:[~2018-07-03 7:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-02 21:30 [PATCH] hwmon: Mark expected switch fall-throughs Gustavo A. R. Silva
2018-07-03 7:51 ` Jean Delvare [this message]
2018-07-03 17:20 ` Gustavo A. R. Silva
2018-07-03 16:13 ` Guenter Roeck
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=20180703095118.5f08abd6@endymion \
--to=jdelvare@suse.de \
--cc=gustavo@embeddedor.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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 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.