Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	"amy.shih" <amy.shih@advantech.com.tw>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] hwmon: (nct7904) Avoid fall-through warnings
Date: Thu, 6 Jun 2019 09:05:38 -0700	[thread overview]
Message-ID: <20190606160538.GA29430@roeck-us.net> (raw)
In-Reply-To: <20190606140659.GA2970@embeddedor>

Hi Gustavo,

On Thu, Jun 06, 2019 at 09:06:59AM -0500, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, this patch silences
> the following warnings:
> 

Thanks a lot for the patch. I pulled the patch introducing the problem
due to other issues with it.

Guenter

> drivers/hwmon/nct7904.c: In function 'nct7904_in_is_visible':
> drivers/hwmon/nct7904.c:313:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    if (channel > 0 && (data->vsen_mask & BIT(index)))
>       ^
> drivers/hwmon/nct7904.c:315:2: note: here
>   case hwmon_in_min:
>   ^~~~
> drivers/hwmon/nct7904.c: In function 'nct7904_fan_is_visible':
> drivers/hwmon/nct7904.c:230:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    if (data->fanin_mask & (1 << channel))
>       ^
> drivers/hwmon/nct7904.c:232:2: note: here
>   case hwmon_fan_min:
>   ^~~~
> drivers/hwmon/nct7904.c: In function 'nct7904_temp_is_visible':
> drivers/hwmon/nct7904.c:443:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    if (channel < 5) {
>       ^
> drivers/hwmon/nct7904.c:450:2: note: here
>   case hwmon_temp_max:
>   ^~~~
> 
> Warning level 3 was used: -Wimplicit-fallthrough=3
> 
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  drivers/hwmon/nct7904.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/hwmon/nct7904.c b/drivers/hwmon/nct7904.c
> index dd450dd29ac7..bf35dfd2d3a7 100644
> --- a/drivers/hwmon/nct7904.c
> +++ b/drivers/hwmon/nct7904.c
> @@ -229,6 +229,7 @@ static umode_t nct7904_fan_is_visible(const void *_data, u32 attr, int channel)
>  	case hwmon_fan_alarm:
>  		if (data->fanin_mask & (1 << channel))
>  			return 0444;
> +		break;
>  	case hwmon_fan_min:
>  		if (data->fanin_mask & (1 << channel))
>  			return 0644;
> @@ -312,6 +313,7 @@ static umode_t nct7904_in_is_visible(const void *_data, u32 attr, int channel)
>  	case hwmon_in_alarm:
>  		if (channel > 0 && (data->vsen_mask & BIT(index)))
>  			return 0444;
> +		break;
>  	case hwmon_in_min:
>  	case hwmon_in_max:
>  		if (channel > 0 && (data->vsen_mask & BIT(index)))
> @@ -447,6 +449,7 @@ static umode_t nct7904_temp_is_visible(const void *_data, u32 attr, int channel)
>  			if (data->has_dts & BIT(channel - 5))
>  				return 0444;
>  		}
> +		break;
>  	case hwmon_temp_max:
>  	case hwmon_temp_max_hyst:
>  	case hwmon_temp_emergency:
> -- 
> 2.21.0
> 

      reply	other threads:[~2019-06-06 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 14:06 [PATCH] hwmon: (nct7904) Avoid fall-through warnings Gustavo A. R. Silva
2019-06-06 16:05 ` Guenter Roeck [this message]

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=20190606160538.GA29430@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=amy.shih@advantech.com.tw \
    --cc=gustavo@embeddedor.com \
    --cc=jdelvare@suse.com \
    --cc=keescook@chromium.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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