Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp930782imm; Sat, 7 Jul 2018 12:04:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd9Trf8k4Pzum+PE/vdmwsBeRvKt7yirQ46qQxw+l1zdRjT47WLgpaoCKeE7reoK11oDCQ8 X-Received: by 2002:a62:6d42:: with SMTP id i63-v6mr15218564pfc.41.1530990259304; Sat, 07 Jul 2018 12:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530990259; cv=none; d=google.com; s=arc-20160816; b=N9OIRRkl02ZgglE8849eixkK6ymxY1z/DoW5ZsPaVqJk7EcKjEi9gtKGggQmMpqKmV 39MWWc0e7QBxNUAWWopfbyCSrT/Un3r0ODcBh6i16c3UrNqAXr+jQgQ02R03w6WmWJta 3fK1iVwR6rNihhBIV+MabxVyCxM3dJ39qfbS98D+nEhv/E3Q4oY7sXQptVhs77zNLw5e BIE4A54uiouoYknnXEAvVujoEKAO2h2SHxue7jIoPIsC9rapZLmuA1bhtFYpA2iKIdHi WEJljOCoF1WaRW1cZhS7jJjt2quGxBFh2+Cx+1hObjcJ5f/8SRMHZkpRVa6M2DH5wtMS 5KKA== 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:arc-authentication-results; bh=s6qGEP4L1DDFrdknqDhgjiYBSqSZbzEXlOQI14pkXKU=; b=y9wRlrfbslWjsseriYvUfpf2l07eOW4MxzJd/dAbNOZU/qFeU2KktPps+iiauMsNCP YWqQ2WLQev7QCsULar5OPgmFIC8xltVgXypWkqVyCsvbMnWJgGXdAJ+o0xfhift/tD3C IXnAd9BTHG/tG8YRvOCftsCpSGn4/yif5n8y4maFGE2s2YT6Ys57gYW+xZc8lAiwBJPx vWHnyUuh/c9EX76LnxXxXYw6NEggo+P5S/AwuNy4ePMxqeLNFV/5yHgNmPNwUnFcHSpc Uc8OO+6af8heOHSN/hyKOmMSD6GjBwjVuR9jbZPXcv2c4k4DkifgDEowgu3PBAfT6+1M zfxw== 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 l20-v6si10282652pgo.471.2018.07.07.12.04.04; Sat, 07 Jul 2018 12:04:19 -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; 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 S1754331AbeGGTCH (ORCPT + 99 others); Sat, 7 Jul 2018 15:02:07 -0400 Received: from picard.linux.it ([213.254.12.146]:54480 "EHLO picard.linux.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754312AbeGGTCG (ORCPT ); Sat, 7 Jul 2018 15:02:06 -0400 X-Greylist: delayed 339 seconds by postgrey-1.27 at vger.kernel.org; Sat, 07 Jul 2018 15:02:05 EDT Received: from taihen.jp (unknown [IPv6:2405:6580:2420:3e00:517b:ea2d:893:99d2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPSA id CCE5D3E6C37; Sat, 7 Jul 2018 20:56:22 +0200 (CEST) Date: Sun, 8 Jul 2018 03:56:17 +0900 From: Mattia Dongili To: Darren Hart 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: <20180707185616.GA7168@taihen.jp> References: <20180705204703.GA12352@embeddedor.com> <20180706232427.GC3041@fury> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180706232427.GC3041@fury> X-Message-Flag: Cranky? Try Free Software instead! X-Operating-System: Linux 4.17.0+ x86_64 X-Editor: Vim http://www.vim.org/ X-Disclaimer: Buh! User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 :wq!