Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp243251pxa; Fri, 14 Aug 2020 03:01:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnTVlT3QWmN13NQqheNFONqZWxHt+yldmfI1Cxq3p8r0zP4Uqi7GacXswAQUfcAZxsolXU X-Received: by 2002:a17:906:12d8:: with SMTP id l24mr1611853ejb.260.1597399276960; Fri, 14 Aug 2020 03:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597399276; cv=none; d=google.com; s=arc-20160816; b=dVOg0vRFJ7vcO7VVmNsNAnsIP+cKeCyqnffCzu8Z5IPc6dwFb7YcmpuasxdGLTrSn8 obgIoKDuS+HQ7Hrw78HZyfD5OBrYVDHndRW2VIVWuzZw8Kbl3XdA3s62aW7VOIXcr58m yEJMiCmvshkgKfEEY5rg9AG2K+aa5xG9Zv657BEJy/V6U5iqlpqS/5WQ+4c01184g3OR HjtsjkPl6SI/ORvScouDh5+EMgp3RN0rpRBbQ+RpMkogU0F1+v2H7ddKCtvBcc86n4Ot Q304cjL2+pZ9xZwJSUtq6KNEFGRAqmV/7OkTSRCK7KfpPZgctbtu4gYt/+pKq39ogLmk IOnw== 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:mime-version :message-id:date:subject:cc:to:from; bh=UD6Sfy2+Gg3q427isXqxUsQzPHB6/K9tmlXsJ0YW5pY=; b=A6t+I8pWTfQ5k+rKVifUOqSc+Rcy1UlnL9jriVIP6EUDIyRLALTM/MZBNcmrV9NQy2 L1Ode/WeZjJAY416UjO39F1GYR5Tohol3BhLzxCGtJWcGoxWQENZLStagROsYW7byaY2 45v+MsT5phTqXDcnHuxHoS/Q4mrWIpt/ysVkl4qhqhltvo+DEQ1QLOYrweRXtXeupa2A hoQW8Vg4BZdWhjJNvkd3Mm4/yvBFg77nuc6bfv2UwTGlMkuVBvZsjDAlTpEUGdoMHHfM SeLdCI3zwOL5wq0XoXN+/LOJZcnJtv7infuvuoMSAvqQ834132lzergifV1qohB1zLaG R5hw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rl7si4867591ejb.264.2020.08.14.03.00.53; Fri, 14 Aug 2020 03:01:16 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbgHNJR3 (ORCPT + 99 others); Fri, 14 Aug 2020 05:17:29 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55184 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726012AbgHNJR3 (ORCPT ); Fri, 14 Aug 2020 05:17:29 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 439A98782C52AFCEDB9D; Fri, 14 Aug 2020 17:17:26 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Fri, 14 Aug 2020 17:17:18 +0800 From: Miaohe Lin To: , , , , , , , , , , CC: , , , Subject: [PATCH] bpf: Convert to use the preferred fallthrough macro Date: Fri, 14 Aug 2020 05:16:15 -0400 Message-ID: <20200814091615.21821-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the uses of fallthrough comments to fallthrough macro. Signed-off-by: Miaohe Lin --- kernel/bpf/cgroup.c | 2 +- kernel/bpf/cpumap.c | 2 +- kernel/bpf/syscall.c | 2 +- kernel/bpf/verifier.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c index 83ff127ef7ae..e21de4f1754c 100644 --- a/kernel/bpf/cgroup.c +++ b/kernel/bpf/cgroup.c @@ -1794,7 +1794,7 @@ static bool cg_sockopt_is_valid_access(int off, int size, return prog->expected_attach_type == BPF_CGROUP_GETSOCKOPT; case offsetof(struct bpf_sockopt, optname): - /* fallthrough */ + fallthrough; case offsetof(struct bpf_sockopt, level): if (size != size_default) return false; diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c index f1c46529929b..6386b7bb98f2 100644 --- a/kernel/bpf/cpumap.c +++ b/kernel/bpf/cpumap.c @@ -279,7 +279,7 @@ static int cpu_map_bpf_prog_run_xdp(struct bpf_cpu_map_entry *rcpu, break; default: bpf_warn_invalid_xdp_action(act); - /* fallthrough */ + fallthrough; case XDP_DROP: xdp_return_frame(xdpf); stats->drop++; diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 86299a292214..1bf960aa615c 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -2029,7 +2029,7 @@ bpf_prog_load_check_attach(enum bpf_prog_type prog_type, case BPF_PROG_TYPE_EXT: if (expected_attach_type) return -EINVAL; - /* fallthrough */ + fallthrough; default: return 0; } diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index ef938f17b944..1e7f34663f86 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -2639,7 +2639,7 @@ static bool may_access_direct_pkt_data(struct bpf_verifier_env *env, case BPF_PROG_TYPE_CGROUP_SKB: if (t == BPF_WRITE) return false; - /* fallthrough */ + fallthrough; /* Program types with direct read + write access go here! */ case BPF_PROG_TYPE_SCHED_CLS: @@ -5236,7 +5236,7 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, off_reg == dst_reg ? dst : src); return -EACCES; } - /* fall-through */ + fallthrough; default: break; } @@ -10988,7 +10988,7 @@ static int check_attach_btf_id(struct bpf_verifier_env *env) default: if (!prog_extension) return -EINVAL; - /* fallthrough */ + fallthrough; case BPF_MODIFY_RETURN: case BPF_LSM_MAC: case BPF_TRACE_FENTRY: -- 2.19.1