Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp964544ybm; Wed, 22 May 2019 14:48:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7D+NwpVSOr74zvV+kHNznZyNfD9U0fXtOhM/47HP3+3z/wWg2ujA82bM5TV0BR9JmMfQu X-Received: by 2002:a17:902:18b:: with SMTP id b11mr67659299plb.264.1558561701222; Wed, 22 May 2019 14:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558561701; cv=none; d=google.com; s=arc-20160816; b=wWMZPG1weJBF8ksTtDMkYQVAeS//P0HxNpWV/w4rSHhgtHAXPfpDwfkFl8e5n3NkpO ES/CC7ypya4fBXIZQGZfs5zv7+alono7OXWHFomvqORYc1Ej/igVaE48ZU4uYm07AG90 KjSIrZZrmkb3iMzLLn6JY5j6CIDb+gZow9iA/3srm33gF6ROAPDpB4dGEWoUK2t5KSxI fFxvsQe+A7MLHEBNA96HwMwxSARePcXylVLKqbt3pgHi3rXLz7X4bqKVqO53dm8ayJXZ mFzptpJ/p/3sBYawRhmy83TTW5JiSzGl9p9nfDFqlVVlaKTsQmsEKKIXy7qWbUWox4O2 KD9g== 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=3msBjqVTJ1kTESQU/rT/HU56k2o0e/t/iRqw2p4BFfY=; b=P1lazvGuba25WlePqAGUf6vt39I4XNFzfIr0tioH+kzD/tgpuwxTVL6TqBH7/33C6L xnwqnYJKgr5/OtXiqMPVS1M1jwNKTifiXsrSWHEOHRL7gGknm/lLWJ46/cTi+X/rBeBk AWMszdjxi4PfBXahhx7mUAPrh8HtEOBB3zF21OjHrl1YKtrVhwghEscGmQv18norxJe/ jutfESJNAKJwu4UQYCl8TzuEkQEXYtmsxOSpvhL6OyWooRergVsh4HsW9PZptBifuk8E nuj/SQ/X9yBaA5lzlR4BebYpWK9XqolnhYz2JNFDC7nwwnv55uJizmPK1jf/PNKBFFT4 KTpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=T9zHpWyJ; 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 j12si19353903plt.101.2019.05.22.14.48.06; Wed, 22 May 2019 14:48:21 -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=T9zHpWyJ; 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 S1730571AbfEVVpS (ORCPT + 99 others); Wed, 22 May 2019 17:45:18 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:42646 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728615AbfEVVpS (ORCPT ); Wed, 22 May 2019 17:45:18 -0400 Received: by mail-pf1-f195.google.com with SMTP id 13so2008089pfw.9 for ; Wed, 22 May 2019 14:45:17 -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=3msBjqVTJ1kTESQU/rT/HU56k2o0e/t/iRqw2p4BFfY=; b=T9zHpWyJquwaUzakm+kApDt3POLoWJmKmRWBvXBVb+0YhVraKV+b6OnKSVvkmoVMTb m5E8aUR9YkzfPrDM9G36OUhEe0XDYAFFMRtUG23mFfC+ltHlRynUtamdsVMcO+SQGnrh aZ7n046ymukpCPNU/EMXN0YGHGxXsG2sJsUwM= 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=3msBjqVTJ1kTESQU/rT/HU56k2o0e/t/iRqw2p4BFfY=; b=CwAFhyrbNTr19XzTsdB6oCIhXtEeUe3k4MNzPj41pW616BVG26rnacfi9griDM5mA5 cRWqRKmWt+0djmzqP7uogyoDBpEE04RDOXnKmCQ9/kiE83/ryaJx8xSd85zGJGJ3x7aI 7ulBzNXk10KQSnUce48b/HFF8xh1jYF0cnALRKcev0VKjbTqIYM+GOjaR75hPVhJYIPL QC7o7z1d2F8zXvMj+LhKlPjjLfmqGotdOqV3e1AcILZNT6fRXTSDQ9xJcuTZuYXIO/T7 7dXHCS2KuF1Zuuq6DMdcBqgYOtlDS5mryzL3aSqXH5pokaJgM5TdV4dRN6Gpw8HHje04 uSqw== X-Gm-Message-State: APjAAAVrVglxB2Rvbl2d4l/PLgWcrvL1qzIUnB1vN1odnqRJK1XG2Itp LnWWCsV1s0iIw8vQtqWC4LfO9Q== X-Received: by 2002:aa7:8219:: with SMTP id k25mr5697545pfi.38.1558561517334; Wed, 22 May 2019 14:45:17 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b3sm44151294pfr.146.2019.05.22.14.45.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 May 2019 14:45:16 -0700 (PDT) Date: Wed, 22 May 2019 14:45:15 -0700 From: Kees Cook To: Boris Brezillon Cc: "Gustavo A. R. Silva" , Kyungmin Park , Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: onenand_base: Avoid fall-through warnings Message-ID: <201905221444.014568B0F4@keescook> References: <20190522180446.GA30082@embeddedor> <20190522233705.234d75d5@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190522233705.234d75d5@collabora.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 22, 2019 at 11:37:05PM +0200, Boris Brezillon wrote: > > @@ -3280,12 +3280,14 @@ static void onenand_check_features(struct mtd_info *mtd) > > if ((this->version_id & 0xf) == 0xe) > > this->options |= ONENAND_HAS_NOP_1; > > } > > + /* Fall through - ? */ > > So, the only thing that you'll re-use by falling through the next case > is the '->options |= ONENAND_HAS_UNLOCK_ALL' operation. I find it easier > to follow with an explicit copy of this line + a break. > > > > > case ONENAND_DEVICE_DENSITY_2Gb: > > /* 2Gb DDP does not have 2 plane */ > > if (!ONENAND_IS_DDP(this)) > > this->options |= ONENAND_HAS_2PLANE; > > this->options |= ONENAND_HAS_UNLOCK_ALL; > > + /* Fall through - ? */ > > This fall through certainly doesn't make sense, as the only thing that > might be done in the 1Gb case is conditionally adding the > HAS_UNLOCK_ALL flag, and this flag is already unconditionally set. > Please add a break here. > > > > > case ONENAND_DEVICE_DENSITY_1Gb: > > /* A-Die has all block unlock */ > Your reply was much more to-the-point than mine. :) I'd agree: retain existing behavior (ONENAND_HAS_UNLOCK_ALL) and add breaks. -- Kees Cook