From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EA76C43464 for ; Thu, 17 Sep 2020 21:46:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C8CB2083B for ; Thu, 17 Sep 2020 21:46:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="TWVIG1xe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726037AbgIQVqB (ORCPT ); Thu, 17 Sep 2020 17:46:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbgIQVqA (ORCPT ); Thu, 17 Sep 2020 17:46:00 -0400 Received: from mail-qk1-x74a.google.com (mail-qk1-x74a.google.com [IPv6:2607:f8b0:4864:20::74a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76805C06174A for ; Thu, 17 Sep 2020 14:46:00 -0700 (PDT) Received: by mail-qk1-x74a.google.com with SMTP id 205so2801410qkd.2 for ; Thu, 17 Sep 2020 14:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=IhKMP2yDqla4bVCkJ4x51hskFiR/f7svOYkmrG2KUNE=; b=TWVIG1xeekErrOWhlV/nnA95BVALmStjr90hXy/egUz8wcg3E7GRjsC/6lUH7WXmVS WP2xLDEH9zdJ5H4JOeOjACFo4v6PzBNl+fPBYMRsvX7ScJZsTnym7BQ0WaAkujxIH1bo ZNGnhG2+/3JenN40EmcHrLeuN/YJX72pwiec2eiHBdeLk+dNhqI06ADPH6+oBcsAhOMN ORyP4k58pVw5u+A8aaljsWgSm5XhiljRIH54YphSCpJaJ5cWx5Nq//cFJZiLGnp3GzfU g3nphqn8pyMDlyMqyBmSX6J/BIRswGQd8FExW3fSz6/JX1Hfz3VjXJcNIEXWkfnsm9D2 mw4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=IhKMP2yDqla4bVCkJ4x51hskFiR/f7svOYkmrG2KUNE=; b=IU2OwTqU65tJE8J97yJkwiPr6sqXWADiFKWJH9EVLNg/bid7pGLfc5oyN9szLLIat9 R41P83+SckaWdHVQqCUYiVSwMLQqB+UrSg1JFz8kRRuVYaOdxhDDjkKhDaYVk2KkcI8u /Hcu9MSmH0KNlDjc4Xj/fWqIFGKIRAOL8XiRKJQfUMAdiGaiZCAJapiYSJ0RcTgKPV5h l9Srkl4FTi9gNG5UiSvn4Whhk4B1PbNwrNlFIlVFBpMsYT19Z6HE+szSXtmZNrLXi4Hk XvJED8nPVTFToD+nlJLc407gy7mJFfwiPQMKPplbx7fTEwetWUMDl/qpnTN8VD2mq27j tZPA== X-Gm-Message-State: AOAM530dNYN+UbP39yEFbnpcy8KWg/bx/1SRaBNc+hmCPOQ0YcEOUZr6 nU3OgZonNIB8GPE1V96iFtUupvc7jEE7bQ8/N7o= X-Google-Smtp-Source: ABdhPJzHIimFKFdpvNlyjrJFZoq+9sht5as+u3dxKNL5X6CgRp/ja15bbH7/Fz9n2O8EwngZkHNGrzkGuL4Rca57TYE= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:f693:9fff:fef4:4d25]) (user=ndesaulniers job=sendgmr) by 2002:ad4:5745:: with SMTP id q5mr30422692qvx.29.1600379158156; Thu, 17 Sep 2020 14:45:58 -0700 (PDT) Date: Thu, 17 Sep 2020 14:45:45 -0700 In-Reply-To: Message-Id: <20200917214545.199463-1-ndesaulniers@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [PATCH v3] nfs: remove incorrect fallthrough label From: Nick Desaulniers To: Trond Myklebust , Anna Schumaker Cc: "Gustavo A . R . Silva" , Joe Perches , Nick Desaulniers , "Gustavo A . R . Silva" , Miaohe Lin , Nathan Chancellor , Hongxiang Lou , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no case after the default from which to fallthrough to. Clang will error in this case (unhelpfully without context, see link below) and GCC will with -Wswitch-unreachable. The previous commit should have just replaced the comment with a break statement. If we consider implicit fallthrough to be a design mistake of C, then all case statements should be terminated with one of the following statements: * break * continue * return * fallthrough * goto * (call of function with __attribute__(__noreturn__)) Fixes: 2a1390c95a69 ("nfs: Convert to use the preferred fallthrough macro") Link: https://bugs.llvm.org/show_bug.cgi?id=47539 Acked-by: Gustavo A. R. Silva Reviewed-by: Gustavo A. R. Silva Reviewed-by: Miaohe Lin Reviewed-by: Nathan Chancellor Suggested-by: Joe Perches Signed-off-by: Nick Desaulniers --- Changes v3: * update the commit message as per Joe. * collect tags. Changes v2: * add break rather than no terminating statement as per Joe. * add Joe's suggested by tag. * add blurb about acceptable terminal statements. fs/nfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index d20326ee0475..eb2401079b04 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -889,7 +889,7 @@ static struct nfs_server *nfs_try_mount_request(struct fs_context *fc) default: if (rpcauth_get_gssinfo(flavor, &info) != 0) continue; - fallthrough; + break; } dfprintk(MOUNT, "NFS: attempting to use auth flavor %u\n", flavor); ctx->selected_flavor = flavor; -- 2.28.0.681.g6f77f65b4e-goog