Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp90569yba; Wed, 8 May 2019 16:59:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjUBBn/laoDRwVLpUkQ6JIwronmeS4D6RG7IYl+Zp63GmLAlSVHTfdcoWKmi4dl6z0Yhpa X-Received: by 2002:a65:430a:: with SMTP id j10mr1236249pgq.133.1557359996630; Wed, 08 May 2019 16:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557359996; cv=none; d=google.com; s=arc-20160816; b=OkaGfEXxk2DD7OHswY7P9U4258oxZTJUO1YquLKV++i6gpHtanoUcSOFQTWjcRq0+m jHdGXqjF1MRz4G/E3U6iLK5QZqkkbvYTyI1Bl4v1rvfCwcqt9gUCNcKGLnLzN/ykPkZd 6n5QGCpHMtvuHB5VE3KANsOTiMsLhHNl25PJ59+/mU3I+HBYe4vMlHcLyY/yCS7SnZar p9HgAZG4t2EJyS2uFw85ALt5+1sEvSnHwLDNkBLN9sSUv3NVF0PAIj1v+TlA9eBIUtwV IgeZnsTF+4jdBohHWaECvq7dvcKmY/5zokxjMEOPtssf5qhqbyyNGzGZAeh4RNCmtENZ A1lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hQZD7KxlOTP7+vnGKWKCqYXK/isFooIL1sZyygnqlN4=; b=IZ3cfYVqEVwWkFj1tvO3y6Lxy16gvEuru7iRMgJoXCHHBafSUQ4wjleoiSP3LmxA+9 AubgZ98ZZDCPxwxc593o9BQDzB8wwhS8Wh+T0o39nbhcL7+iEMCfbQVKBt0Odly0Q/Jk iLQMqSu73QSh3dl2XzOBVLrSW9DlqDUTUolToJ8ALM11tvXXHNqnBxnEJ8pOFNFnNeeB 1NnCNygUwlsCYtMD4xhUMgiqmd03XCESJeL8HpSVnwLlc0kbPG0IE54WcZSck0j8470a 2hD7H1MMbVlecv9vZJVlEBugCseLeHeg8WIKT+fPtUyDxyXCsOiIbpemomktWczavga6 zENg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=pC9WFVDV; 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 8si577869pgp.80.2019.05.08.16.59.40; Wed, 08 May 2019 16:59:56 -0700 (PDT) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=pC9WFVDV; 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 S1728658AbfEHXGv (ORCPT + 99 others); Wed, 8 May 2019 19:06:51 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:53454 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726902AbfEHXGu (ORCPT ); Wed, 8 May 2019 19:06:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hQZD7KxlOTP7+vnGKWKCqYXK/isFooIL1sZyygnqlN4=; b=pC9WFVDVjyzdcNOFj4cM2zFYfi os5FltodzYudEuL3rWkXDUKvUf33y78xa7aN9QMjFdkn8wZ14k2IAf0R8IPsgK0X2ooKkDqqa84Ol bulKSOl+D7cQGbROt6FP3/sSxtYGEx4bW88+i5x1ySD1u6/ho2jUdPW6Lq+XVJ8IR+VW9376H2NfI 15bmEM6Otyj19lEjTv05+g4iyy0vu/jmIfXD2R99Is269iinVdXRVRL25mvjOv1sQUzHicnhJd0lq sDKQPBm3D/THEkZtakMx3I8CiXeTRqk88dUJVzoqi1+bAhFYSd1kz9RkhXEW4wX9nRkjh3LyH3jfR nMDr5hKA==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOVeB-0001jR-8m; Wed, 08 May 2019 23:06:47 +0000 Date: Wed, 8 May 2019 16:06:46 -0700 From: Darren Hart To: "Gustavo A. R. Silva" Cc: "Lee, Chun-Yi" , Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook Subject: Re: [PATCH] platform/x86: acer-wmi: Mark expected switch fall-throughs Message-ID: <20190508230645.GB32286@wrath> References: <20190508164934.GA20064@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190508164934.GA20064@embeddedor> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 08, 2019 at 11:49:34AM -0500, Gustavo A. R. Silva wrote: > In preparation to enabling -Wimplicit-fallthrough, mark switch > cases where we are expecting to fall through. > > This patch fixes the following warnings: > > drivers/platform/x86/acer-wmi.c: In function ‘set_u32’: > drivers/platform/x86/acer-wmi.c:1378:33: warning: this statement may fall through [-Wimplicit-fallthrough=] > if (cap == ACER_CAP_WIRELESS || > ^ > drivers/platform/x86/acer-wmi.c:1386:3: note: here > case ACER_WMID: > ^~~~ > drivers/platform/x86/acer-wmi.c:1393:12: warning: this statement may fall through [-Wimplicit-fallthrough=] > else if (wmi_has_guid(WMID_GUID2)) > ^ > drivers/platform/x86/acer-wmi.c:1395:3: note: here > default: > ^~~~~~~ > drivers/platform/x86/acer-wmi.c: In function ‘get_u32’: > drivers/platform/x86/acer-wmi.c:1340:6: warning: this statement may fall through [-Wimplicit-fallthrough=] > if (cap == ACER_CAP_MAILLED) { > ^ > drivers/platform/x86/acer-wmi.c:1344:2: note: here > case ACER_WMID: > ^~~~ > drivers/platform/x86/acer-wmi.c: In function ‘WMID_get_u32’: > drivers/platform/x86/acer-wmi.c:1013:6: warning: this statement may fall through [-Wimplicit-fallthrough=] > if (quirks->mailled == 1) { > ^ > drivers/platform/x86/acer-wmi.c:1018: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/platform/x86/acer-wmi.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c > index fcfeadd1301f..bd87f9037f95 100644 > --- a/drivers/platform/x86/acer-wmi.c > +++ b/drivers/platform/x86/acer-wmi.c > @@ -1015,6 +1015,7 @@ static acpi_status WMID_get_u32(u32 *value, u32 cap) > *value = tmp & 0x1; > return 0; > } > + /* fall through */ > default: > return AE_ERROR; > } > @@ -1341,6 +1342,7 @@ static acpi_status get_u32(u32 *value, u32 cap) > status = AMW0_get_u32(value, cap); > break; > } > + /* fall through */ This doesn't strike me as obviously the right thing to do here. If the interface type is AMW0_V2, why is it the right thing to do to use WMID_get_u32 if the cap isn't ACER_CAP_MAILLED? > case ACER_WMID: > status = WMID_get_u32(value, cap); > break; > @@ -1383,6 +1385,7 @@ static acpi_status set_u32(u32 value, u32 cap) > > return AMW0_set_u32(value, cap); > } > + /* fall through */ Similarly here. Are we documenting intended behavior, or covering up a bug. > case ACER_WMID: > return WMID_set_u32(value, cap); -- Darren Hart VMware Open Source Technology Center