Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3777459ybi; Mon, 29 Jul 2019 12:26:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyS7mBWIDZzVqo+lRfFrQ7CkHRW9Pw+eky3AtbsOflk4MaagOuMf29jwLvGk5d9SftrOJa4 X-Received: by 2002:aa7:8a92:: with SMTP id a18mr38676087pfc.216.1564428368621; Mon, 29 Jul 2019 12:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564428368; cv=none; d=google.com; s=arc-20160816; b=qcvHRzOaMLfm8Yd9x+JVHPEc2vSf9ZinWjuilBFwKFKj1yaBaXGgNG8HDnFqAVeGHU 47CHp8Tjg2VkaAumOIrlnc3xqLwQaXvjdla9u0qbhP7BXo5bXL4+ZC+gzjtwkJRPKc3I U9BK7x2pcYtxXgxrR1T1i9V7mMvKgMWJXEvzkI947p0PGOE1hPXK6+cW+RSZ/4PRjoKl Ba/dd9k2Pm8ZHyAZHamGVkx5WdA93N2QZuNwhyPELCkmmyXmZtcG6j2DHRDLkpMMtj6Y UJVlYOC9o0A+eMNLkB88KFB1CDBBDYZabtvVKbpcCozfE0xbFo48t/kDO3IyO2620rvK UWRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=IEddiYi3k/QkBC5cxfQW5fAN4XjjJLsCvTR0ynzn9xQ=; b=zDBVsab5jz7cU/Z6Hy4eVYGJfqhFNrEzR7mmhE0aNrfr160v24oBllo42v/qY9Cs2d 0BF94WPetccVzFCJ001D7bNIb2EcL7lDZX79uutg+pP+NZAIcG9qCd7XZghEKv6ByP1T 5c1s0YLdhEkwRL29byX/PtIHw2XPwybIL5e0pPC1YrUw9eW+eSGo0BUDumiMjthvVPG9 n4k0HQ7w4QcvNEolokRVEcVIN2LRVSC5AB7agdkx3fn8uUZX6oU3jxbdZt436H5v/eCk +M/F+ilApCKKzNik2SyVVGSU5LulP5l7mTDUAk1YKv8faB9Dkj7Uhk5Cu6qnhcX6Yuoq Wy7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PFOOf1pY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b35si26972550plb.249.2019.07.29.12.25.54; Mon, 29 Jul 2019 12:26:08 -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=pass header.i=@chromium.org header.s=google header.b=PFOOf1pY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387538AbfG2Qfn (ORCPT + 99 others); Mon, 29 Jul 2019 12:35:43 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39457 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387493AbfG2Qfm (ORCPT ); Mon, 29 Jul 2019 12:35:42 -0400 Received: by mail-pg1-f196.google.com with SMTP id u17so28527366pgi.6 for ; Mon, 29 Jul 2019 09:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IEddiYi3k/QkBC5cxfQW5fAN4XjjJLsCvTR0ynzn9xQ=; b=PFOOf1pY2vYwMTBzCHhJbt6J3OJX9kEF5fPBmfilOEVHC7yfX6C8vdygMvSnG/ORXJ +ubu/CTvk6N9l3Hpyyd3g4nctPRzdxe6Wq1t3Eb4eDZho2NwHODoNKaBeWPkSiWF672+ wwNrEzYzu+TH35C5nW4a1HvCbhiXC4sOnUUAk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IEddiYi3k/QkBC5cxfQW5fAN4XjjJLsCvTR0ynzn9xQ=; b=IVczJGCz8Q157xgDT1eqXTkb18OgBKWdPnqPAykBeLuYSFVaUMfv/WLjnAJq/Q5MAI 48o1rwsw2nEipp97Yh+TFwKEyFhsg/FLKI6apoo/YByWse6qJgWbiJgpq49unUWI9xIV tuKGseT2wuO60GmjkY3WpgcRLReMb5fIYTn0KJB682mVbq4icjR1TioHf+dRUKYbmDOb NtoGppovzjMUtteRfUYhIfp9O/2bS2+/Djb/kaoBYaxWZILCucT/lFgmxXs3tymT8s2U pegSngv7p5lvv3TuO8Ywo2CcoqlBDUTMBXePK2/29GaqM1U1s3cvSP1RXTiC3dqCjSHk FPMg== X-Gm-Message-State: APjAAAVuJVWLgnlGeDgmiSJOiM7OXUg8rp6Nm8AHZ7TX8H8yXb+gIx6h LKFgPZpz59MjKV8yATzl4Yx4IQ== X-Received: by 2002:aa7:81ca:: with SMTP id c10mr37907100pfn.185.1564418142347; Mon, 29 Jul 2019 09:35:42 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l26sm63883324pgb.90.2019.07.29.09.35.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jul 2019 09:35:41 -0700 (PDT) Date: Mon, 29 Jul 2019 09:35:40 -0700 From: Kees Cook To: "Gustavo A. R. Silva" Cc: Ludovic Desroches , Ulf Hansson , Nicolas Ferre , Alexandre Belloni , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stephen Rothwell Subject: Re: [PATCH] mmc: atmel-mci: Mark expected switch fall-throughs Message-ID: <201907290935.2B95CBC@keescook> References: <20190729000123.GA23902@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190729000123.GA23902@embeddedor> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 28, 2019 at 07:01:23PM -0500, Gustavo A. R. Silva wrote: > Mark switch cases where we are expecting to fall through. > > This patch fixes the following warnings: > > drivers/mmc/host/atmel-mci.c: In function 'atmci_get_cap': > drivers/mmc/host/atmel-mci.c:2415:30: warning: this statement may fall through [-Wimplicit-fallthrough=] > host->caps.has_odd_clk_div = 1; > ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ > drivers/mmc/host/atmel-mci.c:2416:2: note: here > case 0x400: > ^~~~ > drivers/mmc/host/atmel-mci.c:2422:28: warning: this statement may fall through [-Wimplicit-fallthrough=] > host->caps.has_highspeed = 1; > ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ > drivers/mmc/host/atmel-mci.c:2423:2: note: here > case 0x200: > ^~~~ > drivers/mmc/host/atmel-mci.c:2426:40: warning: this statement may fall through [-Wimplicit-fallthrough=] > host->caps.need_notbusy_for_read_ops = 1; > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ > drivers/mmc/host/atmel-mci.c:2427:2: note: here > case 0x100: > ^~~~ > > Reported-by: Stephen Rothwell > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook -Kees > --- > drivers/mmc/host/atmel-mci.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c > index 9ee0bc0ce6d0..c26fbe5f2222 100644 > --- a/drivers/mmc/host/atmel-mci.c > +++ b/drivers/mmc/host/atmel-mci.c > @@ -2413,6 +2413,7 @@ static void atmci_get_cap(struct atmel_mci *host) > case 0x600: > case 0x500: > host->caps.has_odd_clk_div = 1; > + /* Fall through */ > case 0x400: > case 0x300: > host->caps.has_dma_conf_reg = 1; > @@ -2420,13 +2421,16 @@ static void atmci_get_cap(struct atmel_mci *host) > host->caps.has_cfg_reg = 1; > host->caps.has_cstor_reg = 1; > host->caps.has_highspeed = 1; > + /* Fall through */ > case 0x200: > host->caps.has_rwproof = 1; > host->caps.need_blksz_mul_4 = 0; > host->caps.need_notbusy_for_read_ops = 1; > + /* Fall through */ > case 0x100: > host->caps.has_bad_data_ordering = 0; > host->caps.need_reset_after_xfer = 0; > + /* Fall through */ > case 0x0: > break; > default: > -- > 2.22.0 > -- Kees Cook