Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4537538imj; Tue, 12 Feb 2019 18:49:51 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib/WK+1ossnbP3O3te6kKYO83s06SQdxeuvjndh7RcC7yh5y+fHMrxOgQel6rNEnblLm0dc X-Received: by 2002:a63:235c:: with SMTP id u28mr6766431pgm.400.1550026191199; Tue, 12 Feb 2019 18:49:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550026191; cv=none; d=google.com; s=arc-20160816; b=ecb3Cx6GfUoChqvtVyE6OQ8zyq59t0zDH9NjEuhIN67/d/wp2E9f445nNfvdz1LMuJ pOeuQbktIvtocYM6EADHLBLSxWEiS3/CjTfLSFRpmhrIrJe+h1O3WCVMarYCVdWVzXt5 t5txri8doG14xtCeTG6vRupXR669deve9D0QSKwYwIv4Q0UUp9zsU/ET0g9zhZ6+4lk3 D1Z2BMxuv03TiI0MrhYH/yDHT/q3nWC30Z3lGZvXTY0LdbhuMJb67+F1a6u1AQ/5mrAB VIRIvL14NnG7bdj+n2260Pwc4ifRQiuIpcVJWHndAB5vPyxIPj/6GcGeMygfEnDjj53M ijCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date; bh=UA94hooqZndfi9ErAKkTLM/uz5hBZod/A3iG3fZ2RGw=; b=uj4irMtc08y0n87D+Hks7KWmBtnU0ztzj22o5+Br1DYgSjibfdSw6kGZSE/xkfmt3U oEIZewiPyL0GYL82/ffbbI+1UZiZuTqBrsI3rSl/k5DWqxumL45W0qGRnYOBNx9niLzs B7vywA73nxIsA0ZR4NJR9i01ibw+ZoZownU7emynmSYcNBwnAWxusW9LBlgYqTIV93E1 fAm/eEpKWZLGmvDUhrXWWkDIpCdbf7euyvDNhOUTe0cG6g/S1VaZmYdyHLWGuc8MD3DU Ws907qvPg4+Q2hfZg0hdW1rVBc9lFxxqyazCXiFEv+9m176d6XoE0uJZdZ0MvKUEI2bf D4CQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si5911849plr.303.2019.02.12.18.49.35; Tue, 12 Feb 2019 18:49:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389070AbfBMCsq (ORCPT + 99 others); Tue, 12 Feb 2019 21:48:46 -0500 Received: from gateway21.websitewelcome.com ([192.185.45.133]:22456 "EHLO gateway21.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733035AbfBMCsp (ORCPT ); Tue, 12 Feb 2019 21:48:45 -0500 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 322C2402C3B63 for ; Tue, 12 Feb 2019 20:48:44 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id tkbMgr8WI2PzOtkbMgLobP; Tue, 12 Feb 2019 20:48:44 -0600 X-Authority-Reason: nr=8 Received: from [189.250.119.20] (port=38828 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1gtkbL-001ogo-Bm; Tue, 12 Feb 2019 20:48:43 -0600 Date: Tue, 12 Feb 2019 20:48:42 -0600 From: "Gustavo A. R. Silva" To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , Kees Cook Subject: [PATCH] iio: chemical: sps30: mark expected switch fall-throughs Message-ID: <20190213024842.GA25131@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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.119.20 X-Source-L: No X-Exim-ID: 1gtkbL-001ogo-Bm X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.119.20]:38828 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 6 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warnings: drivers/iio/chemical/sps30.c: In function ‘sps30_read_raw’: drivers/iio/chemical/sps30.c:289:4: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (chan->channel2) { ^~~~~~ drivers/iio/chemical/sps30.c:299:3: note: here default: ^~~~~~~ drivers/iio/chemical/sps30.c: In function ‘sps30_do_cmd’: drivers/iio/chemical/sps30.c:120:10: warning: this statement may fall through [-Wimplicit-fallthrough=] buf[1] = (u8)SPS30_AUTO_CLEANING_PERIOD; ^ drivers/iio/chemical/sps30.c:121:2: note: here case SPS30_READ_DATA_READY_FLAG: ^~~~ drivers/gpio/gpio-eic-sprd.c: In function ‘sprd_eic_irq_set_type’: drivers/gpio/gpio-eic-sprd.c:403:3: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (flow_type) { ^~~~~~ drivers/gpio/gpio-eic-sprd.c:435:2: note: here default: ^~~~~~~ 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/iio/chemical/sps30.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/chemical/sps30.c b/drivers/iio/chemical/sps30.c index e03a28a67146..f308d8ddceec 100644 --- a/drivers/iio/chemical/sps30.c +++ b/drivers/iio/chemical/sps30.c @@ -118,6 +118,7 @@ static int sps30_do_cmd(struct sps30_state *state, u16 cmd, u8 *data, int size) case SPS30_READ_AUTO_CLEANING_PERIOD: buf[0] = SPS30_AUTO_CLEANING_PERIOD >> 8; buf[1] = (u8)SPS30_AUTO_CLEANING_PERIOD; + /* fall through */ case SPS30_READ_DATA_READY_FLAG: case SPS30_READ_DATA: case SPS30_READ_SERIAL: @@ -296,6 +297,7 @@ static int sps30_read_raw(struct iio_dev *indio_dev, return IIO_VAL_INT_PLUS_MICRO; } + /* fall through */ default: return -EINVAL; } -- 2.20.1