Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp865096pxb; Mon, 25 Oct 2021 21:00:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/f+/6Il/stxl0wWQ7plb0LaxNoaxoTHSTZXiniiX+JcW5nj8hNLRFdsHhnjYWAeqe9tr4 X-Received: by 2002:a05:6402:2049:: with SMTP id bc9mr5811363edb.169.1635220822703; Mon, 25 Oct 2021 21:00:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635220822; cv=none; d=google.com; s=arc-20160816; b=oRB189g45WBXGtnBLMWtFuG/5vaqVA80hGpVHKw5choeSuRDjCcB49XOjYjQOaux8K MKTs11WE2udQVrniYuIwRMJlSYv5qlk8CZuuv6AHlKsjyf72w6wOgrrbX4LziJuk9gi6 SrieC8nAb5/8JgJ/4DJ4ueg5bd0TU9MjNN2ohqlQo8B7fnQnc3/oTjsH42tUNWsOa82+ lx5A4marEDB5uLunrE5x+NnWUsaoEABXSn6lC2bLb/9S6cUsxLcRb+0zdEGDhZ4a/9IS qh+4Eb8y3o4lNcFXeoDPXDgIniIj4ppx1xAkT5f273iSLmBPXHXtP1BCy3bGORZHHJTc /1zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HsF+Dp+1GypxzIxzTAttbwUIMTmkJk+DWjjwmSrWzmc=; b=WmV34Cvax17oCfTUOmGNP7A91EoQrcmdpIseQhQ/1SIInvT6qqRm1Yco2Sz2PYLBuT uX8hD+dcr0BmGz+/AR2qHyzrvEJF9D3U9LyfM8eWVNVHBIv7VVtfbHNbIL5Z6TxSGhWO Y/RjY5dVWTQdV5J3YDb1MQ2sk1Clw0H2elOMcyy0zdvug52JwbGqFvHKINbwvgUm4wwR 9t1Y01SANrz75HMEZonBnfZNmFqFOHvcV9eZv2HdjfwlPj4Mw3zo8uAUlvS9BEMKRWBj Fk6ntpMnmGNvvvdfZOdjsqFVJODSopSHvlMW9YTxGGNvG0cgR5Aacy3xO8Z4RRQzjxgl hvIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RAwiXnqd; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qn6si10148043ejb.400.2021.10.25.20.59.57; Mon, 25 Oct 2021 21:00:22 -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=@kernel.org header.s=k20201202 header.b=RAwiXnqd; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234878AbhJYVPa (ORCPT + 99 others); Mon, 25 Oct 2021 17:15:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:43794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234509AbhJYVP3 (ORCPT ); Mon, 25 Oct 2021 17:15:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 14C8860E05; Mon, 25 Oct 2021 21:13:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635196386; bh=01iIj49VElT6TxzwlH2LuH1RkkRDZAWZcL+HbJ6Tfos=; h=From:To:Cc:Subject:Date:From; b=RAwiXnqdWfSWuhGEEmo5Exx4YcI688hOL5Gd45gpTSvLCwk7JKUbGAg7orzXTXcFv RS45vvWuH3a4r4ekE6LsvA4i5JUY4IdW6B0NFjYvKvVhSbs4/AICXOIXyfob8FOGpW 7i8Ce3HT2Dfn1CN54u3KJHTWbGJ+39eo03p2LAdhSk8GSbLjawrTvLy7KfbKIAjVsf tr6SBYTl40R+aahuACM1qoaKsljTFnhyOQsGpWM26DKJ7K54P7hCH7+vgJ/hvK8yvf YKXi8WSlfsLEGnh7NQTNd5N6LNEA2JR7El4nD/6ffiSXoARytzTuB8D0ZyHCbkV69e dckyieN7dZszA== From: Nathan Chancellor To: =?UTF-8?q?=C5=81ukasz=20Stelmach?= , "David S. Miller" , Jakub Kicinski Cc: Nick Desaulniers , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor Subject: [PATCH 1/2] net: ax88796c: Fix clang -Wimplicit-fallthrough in ax88796c_set_mac() Date: Mon, 25 Oct 2021 14:12:38 -0700 Message-Id: <20211025211238.178768-1-nathan@kernel.org> X-Mailer: git-send-email 2.33.1.637.gf443b226ca MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns: drivers/net/ethernet/asix/ax88796c_main.c:696:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] case SPEED_10: ^ drivers/net/ethernet/asix/ax88796c_main.c:696:2: note: insert 'break;' to avoid fall-through case SPEED_10: ^ break; drivers/net/ethernet/asix/ax88796c_main.c:706:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] case DUPLEX_HALF: ^ drivers/net/ethernet/asix/ax88796c_main.c:706:2: note: insert 'break;' to avoid fall-through case DUPLEX_HALF: ^ break; Clang is a little more pedantic than GCC, which permits implicit fallthroughs to cases that contain just break or return. Clang's version is more in line with the kernel's own stance in deprecated.rst, which states that all switch/case blocks must end in either break, fallthrough, continue, goto, or return. Add the missing breaks to fix the warning. Link: https://github.com/ClangBuiltLinux/linux/issues/1491 Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/asix/ax88796c_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/asix/ax88796c_main.c b/drivers/net/ethernet/asix/ax88796c_main.c index cfc597f72e3d..cf0f96f93f3b 100644 --- a/drivers/net/ethernet/asix/ax88796c_main.c +++ b/drivers/net/ethernet/asix/ax88796c_main.c @@ -693,6 +693,7 @@ static void ax88796c_set_mac(struct ax88796c_device *ax_local) switch (ax_local->speed) { case SPEED_100: maccr |= MACCR_SPEED_100; + break; case SPEED_10: case SPEED_UNKNOWN: break; @@ -703,6 +704,7 @@ static void ax88796c_set_mac(struct ax88796c_device *ax_local) switch (ax_local->duplex) { case DUPLEX_FULL: maccr |= MACCR_SPEED_100; + break; case DUPLEX_HALF: case DUPLEX_UNKNOWN: break; base-commit: dcd63d4326802cec525de2a4775019849958125c -- 2.33.1.637.gf443b226ca