From patchwork Thu Jun 6 14:06:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 10979743 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 32869924 for ; Thu, 6 Jun 2019 14:53:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FE5A287F3 for ; Thu, 6 Jun 2019 14:53:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1438328905; Thu, 6 Jun 2019 14:53:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84801287F3 for ; Thu, 6 Jun 2019 14:53:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727603AbfFFOxV (ORCPT ); Thu, 6 Jun 2019 10:53:21 -0400 Received: from gateway34.websitewelcome.com ([192.185.149.13]:44869 "EHLO gateway34.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727559AbfFFOxU (ORCPT ); Thu, 6 Jun 2019 10:53:20 -0400 X-Greylist: delayed 1502 seconds by postgrey-1.27 at vger.kernel.org; Thu, 06 Jun 2019 10:53:20 EDT Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway34.websitewelcome.com (Postfix) with ESMTP id DA1371F8161 for ; Thu, 6 Jun 2019 09:07:04 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id Yt2mhwwY74FKpYt2mhGgxp; Thu, 06 Jun 2019 09:07:04 -0500 X-Authority-Reason: nr=8 Received: from [189.250.127.120] (port=40832 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.92) (envelope-from ) id 1hYt2i-004Dw7-8a; Thu, 06 Jun 2019 09:07:01 -0500 Date: Thu, 6 Jun 2019 09:06:59 -0500 From: "Gustavo A. R. Silva" To: Jean Delvare , Guenter Roeck , "amy.shih" Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , Kees Cook Subject: [PATCH] hwmon: (nct7904) Avoid fall-through warnings Message-ID: <20190606140659.GA2970@embeddedor> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.250.127.120 X-Source-L: No X-Exim-ID: 1hYt2i-004Dw7-8a X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.127.120]:40832 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 4 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In preparation to enabling -Wimplicit-fallthrough, this patch silences the following warnings: 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 --- 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: