Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4661957imm; Tue, 11 Sep 2018 15:51:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdafRy0Yi2sjkQGozUNdMcVY8nyrQTb1Cp4USYxBc5Zmj12nhZ2zZ7cWwQFWs1JXhHB9ysPm X-Received: by 2002:a63:231c:: with SMTP id j28-v6mr30375588pgj.332.1536706310912; Tue, 11 Sep 2018 15:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536706310; cv=none; d=google.com; s=arc-20160816; b=ADL+Ub8nnsmS7Gtd5UVaGuYAMPqXQGaVV8t1hQomB0w6bg29MgGnPxKY4tx/3HTXFW rhKoTnC23lpiJPYUjY+zV3aXD5JPbi9o7fjwgDWOXdRL/LHXLrxTTj1T26NLH/tCRDcT 2Q3sUH7PRxSVyg1u7bSloTWCeiHGNb5Is3rFyhUXv4/U+mYKM0UZEfGJAJNbJe1LWtzA 54F0NL8gwKyHa8qusY5c/L961w3cto9COSUXeJxs1Q6tTVY0Yk8YuuxXNxUGW2kOnCdV VTa02FFau88LQWGQZ5KTsr+56WQupVmSwJqYSC02MTYu+eN+bGWQ2W1Xccqn70OIl457 4UjA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=uSFBtsGTtyxglEE+ce83oXw4stYMRDCEQWoZhgHy0KM=; b=vlfCeWDqD0zs52PL7pPjUZdHEIcWsqEbmSIEBot3/JPWC1KZ4N8O+dVSXF4/qsiAKm DMNDCpqrdxzmDgnQYlvx2vriXqCQ1RBjZs8jUbM79pq7s7Bh1Ix0SK7diSkzWjROfO0G Cw1GRCp2IoFX8lISXhs++q9+Q6ZmnRNw8N4WkXrq/47tN196xZvbEm4fzriZh5ErR7Ma J2LyifdZuIPVrYMgLsooxhI/Wi/MFaz51e1EIZWeMJVNGR1JgYU5IHe0/gdi+swGT6ak EySBi1XkW6LQeGT7XgYOeeYkMfz5XOUkt6IEAMUoKzZ9DbS6q33NWsbI1tD4BFrhmvh/ 8R1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=aCH5xbSf; 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 l63-v6si19779299pgd.598.2018.09.11.15.51.33; Tue, 11 Sep 2018 15:51:50 -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=aCH5xbSf; 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 S1727836AbeILDw4 (ORCPT + 99 others); Tue, 11 Sep 2018 23:52:56 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:58932 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726885AbeILDw4 (ORCPT ); Tue, 11 Sep 2018 23:52:56 -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-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding: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=uSFBtsGTtyxglEE+ce83oXw4stYMRDCEQWoZhgHy0KM=; b=aCH5xbSffyK9VCJgL4TcvSm77 A4bsDcVI2gHBiuW+94AsqzTw+SxYyiLnh9Z4Bh5jpuzEj5FXErgk10lsrs526/jqWyjf+57cYYIbh jyIlvhIVdF2A+6U67VKep0dB9NJUuLOXhEqgAZv8CxKO5awEHqpPh1zUj6Ph1GL7zM957P8vh73QR IctmRcdhukQ2YvPGnH9X4Q3yyRfZ6HpwQFN81mDkqTTe7oMip6eg2vIXJ16WeFW4O+J5DbMUrnszB nLIqNTqaKxbdhCSBpasHwHy7xemseHhVhXRqhIe7TQPb66yhIHZSKUFMy5pdQbvWiegvIqzKLJEFU NHxfEKH2Q==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fzrVC-0000pA-UO; Tue, 11 Sep 2018 22:51:22 +0000 Date: Tue, 11 Sep 2018 15:51:21 -0700 From: Darren Hart To: Mattia Dongili Cc: "Gustavo A. R. Silva" , Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] platform/x86: sony-laptop: Mark expected switch fall-through Message-ID: <20180911225121.GE5659@wrath> References: <20180705204703.GA12352@embeddedor.com> <20180706232427.GC3041@fury> <20180707185616.GA7168@taihen.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180707185616.GA7168@taihen.jp> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 08, 2018 at 03:56:17AM +0900, Mattia Dongili wrote: > On Fri, Jul 06, 2018 at 04:24:27PM -0700, Darren Hart wrote: > > On Thu, Jul 05, 2018 at 03:47:03PM -0500, Gustavo A. R. Silva wrote: > > > In preparation to enabling -Wimplicit-fallthrough, mark switch cases > > > where we are expecting to fall through. > > > > > > Signed-off-by: Gustavo A. R. Silva > > > --- > > > drivers/platform/x86/sony-laptop.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c > > > index b205b03..e614cb7 100644 > > > --- a/drivers/platform/x86/sony-laptop.c > > > +++ b/drivers/platform/x86/sony-laptop.c > > > @@ -4427,6 +4427,7 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) > > > default: > > > dprintk("Resource %d isn't an IRQ nor an IO port\n", > > > resource->type); > > > + /* fall through */ > > > > Here too, I wonder if this is intentional. Either way, from what I can see, the > > final line in the function: > > > > return AE_CTRL_TERMINATE; > > > > Is unreachable as there are no "break" statements in the switch, and the default > > falls through to return AE_OK. Something doesn't seem right here. > > I think so too. Looks to me that the default case was meant to return > AE_CTRL_TERMINATE (i.e. swapping it to be last would do). > > Having written that code aeons ago, I'm not sure if there is a good > reason to be like that, though it still looks like a bug (that > existed ever since...). > > Want to fix it as part of this patch series? Or I can send a patch > myself, let me know. Mattia, I'd prefer to decouple the fix from the implicit fall through discussion. Please send a separate fix. -- Darren Hart VMware Open Source Technology Center