Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp870863imm; Wed, 15 Aug 2018 07:35:53 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyJXkx8xwLoRlBTMoX2dpokdlYdflStUYeO6q28aAxF1OtDxK8BQWfFzxFbifig6eBQR7cu X-Received: by 2002:a63:e355:: with SMTP id o21-v6mr25620625pgj.251.1534343753245; Wed, 15 Aug 2018 07:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534343753; cv=none; d=google.com; s=arc-20160816; b=JLqd6LAbzYE0stEf5ZjdBnSdQ7wSUdKMZmrgLLuNLTefRBW32+x7QNf/0BPtTz1Y/y vlaWhgfatqKEwdXPkQRI+V179cG4Q9u+y0qhYVuvqmlqpTAaVHJ75eGRj3Np58JBEDj7 jK1ThfjL+aiNveAu5m95VvHakpPPdjo8g6uMsaJT/3P/bGvf2sZ2SyZHek5pIQ75Hm38 bnOe9rIiwKg0N5iKqjpMYD5e9RT03jT5ufOSLtDHakNsGVX6JSF9g1NUXoat+MCur84e 9f6iX/GP2/0yvZYEyp0mX7XouLQUaXG6I0LFpMmwOnxbGHid9PU1dciey12Hxf3MwtoP 2eiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=W26SVNuV0Ic1Ue7iJXtjz4o/7KNXxapJvV1hYuqBOLE=; b=n2fgjbi/nNG+kYXhsOYo8+z5V08Jl10AEBnlOkzPffkHX5VVqbUOhR7wBfKHcFOXg1 38u6Zuou3aY0nNN1fGRXU/k15HoNzpKMpYST7aDws28/cgu2fBAKNWQuXaQmeXs60kAF pNXvywkozLuTpiT6DaMU0EIewUOj84by+2vhpiw+6BU5E3ofgxaTbzpVEgXYxlUUtPNY TNyE8buTY9E9Ua6P7NZ/lkurBK5my03aR9DkCySoIfRpJrwdBC7DEYFV6ucGOF0tSMGJ ov4wS1zj5Du1uGBlyC9MvWQZryeut1PrI42ciHoy/+lxAmJfgLjsL8KVm9el9tjVgF4w vsGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ParrWntq; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r23-v6si22806252pgi.409.2018.08.15.07.35.37; Wed, 15 Aug 2018 07:35:53 -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=@linaro.org header.s=google header.b=ParrWntq; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729457AbeHOR0e (ORCPT + 99 others); Wed, 15 Aug 2018 13:26:34 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:44627 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729265AbeHOR0e (ORCPT ); Wed, 15 Aug 2018 13:26:34 -0400 Received: by mail-wr1-f65.google.com with SMTP id r16-v6so1306024wrt.11 for ; Wed, 15 Aug 2018 07:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=W26SVNuV0Ic1Ue7iJXtjz4o/7KNXxapJvV1hYuqBOLE=; b=ParrWntqxwisS+ul2NWmoY+2Q1nZ/XR3ZeN3KUxiecHqYdbAXNI7qYTbfaPDin6zWa UssDA6kUTUQR66mD79+qZNBs0upqTgOsAGp9V52OtZDto4e4mAmquURipjAQBkn+AYnx jpdhFWzaqqTWGXFqkxu6dX/WjYlqwWkq9AKNo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=W26SVNuV0Ic1Ue7iJXtjz4o/7KNXxapJvV1hYuqBOLE=; b=AE2hHpe7UMAX+x4a4WnZzVzu1k0zKlTkhpD/oD4C6U9qjI+QHfG0IAj/rrP3g9OADw phq6aTh5pU4DhnBkBiTT4WOOwTDq7k2ughe4kq10+nCRDYGBwCo2ro4ZOqom0TAG6xoK zXKA7O36jXv1n2IropMnhYi2LLWY2nLoRl5i57ytSXgSSduhNILVkM2qsxj7Yw4Pse+b 1lkCPZG3qXKxkllcNi70HXyrJmlUJGj7m10uMecu6UVaWo0OQDYfYtyvbo6Zovx3OoYD CWNSLkvuMgwo23zR5vH1qiLq1k0s4UkmKBQMjQUbEwGuuwXCjYbNRgiwRHkPYPLPvL+9 q0Sg== X-Gm-Message-State: AOUpUlHZXFMuYwh8IjbDMzDR8ZFodEM0JgADBh6IIvze2gZ9fnr40aCm FelCYxlejomJaHlYmF8IzJTqjjnyky0= X-Received: by 2002:adf:d842:: with SMTP id k2-v6mr15551162wrl.26.1534343649005; Wed, 15 Aug 2018 07:34:09 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.googlemail.com with ESMTPSA id j6-v6sm34559846wrs.91.2018.08.15.07.34.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Aug 2018 07:34:07 -0700 (PDT) Subject: Re: [PATCH] kdb: kdb_main: mark expected switch fall-throughs To: "Gustavo A. R. Silva" , Jason Wessel Cc: kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20180805041454.GA18449@embeddedor.com> From: Daniel Thompson Message-ID: Date: Wed, 15 Aug 2018 15:34:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180805041454.GA18449@embeddedor.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/08/18 05:14, Gustavo A. R. Silva wrote: > In preparation to enabling -Wimplicit-fallthrough, mark switch cases > where we are expecting to fall through. > > Addresses-Coverity-ID: 115090 ("Missing break in switch") > Addresses-Coverity-ID: 115091 ("Missing break in switch") > Addresses-Coverity-ID: 114700 ("Missing break in switch") > Signed-off-by: Gustavo A. R. Silva Adding fall through isn't wrong but its reasonable to ask why there is a complex hand unrolled loop here in the first place (and doubly so without a comment). The whole switch statement would be much clear expressed as: for (j=0; j --- > kernel/debug/kdb/kdb_main.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c > index 2ddfce8..2249645 100644 > --- a/kernel/debug/kdb/kdb_main.c > +++ b/kernel/debug/kdb/kdb_main.c > @@ -1545,13 +1545,16 @@ static void kdb_md_line(const char *fmtstr, unsigned long addr, > *c++ = printable_char(*cp++); > *c++ = printable_char(*cp++); > addr += 4; > + /* fall through */ > case 4: > *c++ = printable_char(*cp++); > *c++ = printable_char(*cp++); > addr += 2; > + /* fall through */ > case 2: > *c++ = printable_char(*cp++); > addr++; > + /* fall through */ > case 1: > *c++ = printable_char(*cp++); > addr++; >