Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp658013ybg; Tue, 28 Jul 2020 15:40:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5yv3nt4YRMRC3Zv5w6kzLKVUmYDAqkD0vYPkH13DXY/j5j0Fbec7M9+SIGbPxcExkbHjK X-Received: by 2002:a17:906:3b01:: with SMTP id g1mr28690361ejf.353.1595976027955; Tue, 28 Jul 2020 15:40:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595976027; cv=none; d=google.com; s=arc-20160816; b=pr8mInYi4mcR6CDZThXPXPW0EzTjMaC74pJPLwfNhN+QcwxP7sGfS0qTwJBcRIsa+q ZSrq6zsmxL3Ip7URm8ZrDuiVLCUzzljWtH4MAf1jWpq0pgIQuUoQMWvT6VlfNdHVEN6u z14lroBKkCC0Ka0hkQbM2/tAr2lY7CGgyEnNgj4iNnxCP01dJFoQz1MvQbViAGsiJ6SP D1etv3hzXUuiuyXgDqLhRmlCDvzLsl57anTX98CEBuBTkagKfMcHiDxvW49iouhEgztc 0mFe8qSXCsygFrTfQGtDQ5Jn7wpGZk7wWS73QCzeNhSRA2LWs0fjL3L50U2QDSr1WywT df0A== 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; bh=EReXMTG1Tmh9rCxrfzcdSSmSqczZSw6FsxufeVNcmCk=; b=BTPClHd6CR+tNqYNgzIBvleU3GD4/y5ZOOuIwo+3pN/v/Fjwim9U6OQwNkk2hRjYyf /KbCz0BAIGxgPRm/mDrQHhWkzt7oSb/HDYbIHKBciBRF7dTfYVox/DNmRLnv6wmXHKwX 1xOuTK37sjexV9anJFoCXkQbwHgb9ez867zuH1Cf8bWJysmiR5kFOzUYfr8cu6HvZX3D Tq9E0LG1cdA2rKFq+3Up3gxNIw3cTK8kmvSwtWC0WWDeJafMOI1nihgRa0idngK4RRoy SHZLyOklYmTfEfZ/D/sNCS4LnUeqAUE6iX4Dgi++0wIrRHSrH8wvQyjyTtus9vGf62fT oXXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b="bho3CI5/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ieee.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z3si8150843ejc.547.2020.07.28.15.40.05; Tue, 28 Jul 2020 15:40:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b="bho3CI5/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ieee.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729808AbgG1WhI (ORCPT + 99 others); Tue, 28 Jul 2020 18:37:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729223AbgG1WhI (ORCPT ); Tue, 28 Jul 2020 18:37:08 -0400 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41F81C061794 for ; Tue, 28 Jul 2020 15:37:08 -0700 (PDT) Received: by mail-io1-xd43.google.com with SMTP id k23so22474132iom.10 for ; Tue, 28 Jul 2020 15:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.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=EReXMTG1Tmh9rCxrfzcdSSmSqczZSw6FsxufeVNcmCk=; b=bho3CI5/KuDuigkKMG34qqAzwgMi8luz6+3vsZ62NeayRJBAxZ6HVuDYac4v5fs6QA LSUt0ZI25na4eiMvDNGdyID1FdA2P+ITGMEI5WOy5v0mDljsHFfxy5PaxteUZZS1QE+d nqDqj/ohZPwpBQE98/QpFWwLVsioKrtGWyFK0= 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=EReXMTG1Tmh9rCxrfzcdSSmSqczZSw6FsxufeVNcmCk=; b=triUySVXKfqWgEyqjNsZ5UXjAiVkEDOL/xhz8hjrw8/g3yc7BCm0lwG9SDoPNOBcPQ O9GKRBGtpZJTByj5ypAOjohBtqZ6V/JXoUkHi9kHnAwliVbnufAnBxp7KOjp32xqObs0 nMfpClUa9up/3zTQfw/i09N+OeY6o5wEhKmJqNpsQnBlOGaEudLnynnhOUcTlTnBE+6U mrLMwTF4zf745K/uW4Hi2Dn8li1TP97guUVl1rmSQ4sA+707kH4tFMKSRUVORBGtyeTp ENhMqb9YAJMxKFT6zYq8w39VmViYwpIP/S88u2hduEtwWSuujo7OGZ9skh7HLTxg+0AU Ep+g== X-Gm-Message-State: AOAM533Ot5Nf9sZDSyfuo53WuGy6O2lVdWEG3YXEHc0O/eiknxZt5Maz hB7HPExCiiQQbJCdLt4Fjfh37Et1NDA= X-Received: by 2002:a05:6638:27a:: with SMTP id x26mr4781663jaq.43.1595975827218; Tue, 28 Jul 2020 15:37:07 -0700 (PDT) Received: from [172.22.22.4] (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.googlemail.com with ESMTPSA id b11sm105864ile.32.2020.07.28.15.37.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jul 2020 15:37:06 -0700 (PDT) Subject: Re: [PATCH][next] greybus: Use fallthrough pseudo-keyword To: "Gustavo A. R. Silva" , Johan Hovold , Alex Elder , Greg Kroah-Hartman Cc: greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org References: <20200727183258.GA28571@embeddedor> From: Alex Elder Message-ID: <63871608-e076-26b0-85df-cff11699c3a3@ieee.org> Date: Tue, 28 Jul 2020 17:37:05 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200727183258.GA28571@embeddedor> 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 7/27/20 1:32 PM, Gustavo A. R. Silva wrote: > Replace the existing /* fall through */ comments and its variants with > the new pseudo-keyword macro fallthrough[1]. > > [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Thanks for the patch. It looks good, but it raises another question I'd like discussion on. It seems that Johan likes default (or final) cases in switch statements without a "break" statement. Viresh and Bryan appear to be fond of this too. It's pedantic, but I don't like that. Am I wrong? --> Johan/Viresh/Bryan would you please comment? If they aren't convincing (or don't care) I think break statements should also be added here: - In gb_interface_read_and_clear_init_status() for the default case - In gb_interface_activate() for the default case. - In gb_svc_process_deferred_request() for the default case But let's wait to see what Johan (et al) says. If you don't want to do that, say so and I'll do it later. I looked at the code in drivers/staging/greybus/ and saw no need to add a "fallthrough" anywhere, but: - In fw_mgmt_backend_fw_version_operation() Viresh seems to have skipped the break in the fault statement - In gb_uart_request_handler() Bryan did this too. Depending on discussion, these could be fixed in a separate patch as well. These cases aren't found by "checkpatch.pl" because it only looks at case "blocks" that are followed by another case. So the last case isn't checked. -Alex > Signed-off-by: Gustavo A. R. Silva > --- > drivers/greybus/es2.c | 2 +- > drivers/greybus/interface.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/greybus/es2.c b/drivers/greybus/es2.c > index 366716f11b1a..1df6ab5d339d 100644 > --- a/drivers/greybus/es2.c > +++ b/drivers/greybus/es2.c > @@ -759,7 +759,7 @@ static int check_urb_status(struct urb *urb) > case -EOVERFLOW: > dev_err(dev, "%s: overflow actual length is %d\n", > __func__, urb->actual_length); > - /* fall through */ > + fallthrough; > case -ECONNRESET: > case -ENOENT: > case -ESHUTDOWN: > diff --git a/drivers/greybus/interface.c b/drivers/greybus/interface.c > index 67dbe6fda9a1..58ea374d8aaa 100644 > --- a/drivers/greybus/interface.c > +++ b/drivers/greybus/interface.c > @@ -1233,7 +1233,7 @@ int gb_interface_add(struct gb_interface *intf) > case GB_INTERFACE_TYPE_GREYBUS: > dev_info(&intf->dev, "GMP VID=0x%08x, PID=0x%08x\n", > intf->vendor_id, intf->product_id); > - /* fall-through */ > + fallthrough; > case GB_INTERFACE_TYPE_UNIPRO: > dev_info(&intf->dev, "DDBL1 Manufacturer=0x%08x, Product=0x%08x\n", > intf->ddbl1_manufacturer_id, >