Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1643487rdb; Sat, 20 Jan 2024 07:18:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IER1qKqVJgfgbC/1TJhiPpq+Ub60HZAiegK7SGbqe+4NQOeovuFbJcwzffdQTTXe7BcFoJ7 X-Received: by 2002:a92:c6cc:0:b0:360:d904:4419 with SMTP id v12-20020a92c6cc000000b00360d9044419mr2256101ilm.28.1705763934111; Sat, 20 Jan 2024 07:18:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705763934; cv=pass; d=google.com; s=arc-20160816; b=zEOD6h9qncOU05d3ejodgI8+Q+ErFliVykX0dZ+h8IvkzJ0KG9S1vg4wHWbDP1zTUv bslZFW6q2k2lFitjbaeKybVzjp5q0uxfM80bd1ycuqEVQ/HHn3lnwm6kreFFeqOoAQkt /7AGrBcC42yJx4qqOb4riRnsmnQhqGf6BdzGVtyjoH4vGdxvhwVxIBtTh601DHoi0RjH ZyIGuBLPTp/2gzcrFU3wYk+ZKRKXn5yAD3Ft7nZK3GkTTeWPLSJUfq2QO+0K6PG5fCaP uMDIp8l1Xqj2igSbfTmiDR6vkQHewTzDXQuPVMUx2kZazou3mYEseVbiu+PP410TpHcm b7Wg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=cTtyoFS24xg79rXI98/8366/8VV6WoWhZD6KqsteBDc=; fh=9LK4+Tjl7UZTpzC+76ZwmHAqO580vwFDxqOuUznG4GE=; b=aGqKdfsoOMVWb8w0c6vvxSKm3Z4AcTCSL2o+YYx1/4a/Ps/2t+MusdSH8FjHcQXZh4 LnFlUZ3E/FhR+pKQlcZx2cfxiYH+cwQ5ddOmCw7lyO40bg3JZ1KDRia7cEbi/7HwNjN+ 3hi03DgLJUrtGez0xYUDq0CwLST93naSb72cnBe1vREEvxXaammzknLCUanLW/bUvUzc hr20MfhBkQpSQroTCl+tLrq8iIVqahIvHjelnMtmcNyC82WjHisAc/iEVj8n8LG1E9+f 2BEZFFDCqdK91CRNAfjmjF2PkqXFiv2Om0kpeN2iH6FtKSYcjuyGhGo2mR0tYxy63XrI YVkA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=der-flo.net); spf=pass (google.com: domain of linux-kernel+bounces-31825-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31825-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v5-20020a632f05000000b005ced65a49e2si5014383pgv.756.2024.01.20.07.18.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jan 2024 07:18:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31825-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=der-flo.net); spf=pass (google.com: domain of linux-kernel+bounces-31825-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31825-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BEAAC28372C for ; Sat, 20 Jan 2024 15:18:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 535231078D; Sat, 20 Jan 2024 15:18:42 +0000 (UTC) Received: from mx.der-flo.net (mx.der-flo.net [193.160.39.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0290FBE5; Sat, 20 Jan 2024 15:18:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.160.39.236 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705763921; cv=none; b=L/RrKUO/CkMgyFxlkhjPyxcN5w9+c2NFYZkxvaj1aEDXIc2EU5Z4uZr8m0eUZA0Sq9Pf233hFusDzteLyYhFqVY5wd0ws734tpQZ5732IGd9kYn64W8PvpQFDhLca5viNTZLMlMuHbbnUcy3zaQSAkSmz6wQBtkkRV3nbCn4B/U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705763921; c=relaxed/simple; bh=Ry63fiM2Ygoj0nLQaTIWzhwo9hiFoOK8qoMwH5xJp5s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=j3RL7mpRRkWs4RfagMBhvWg//UTruJyHOHlB2+JPylLxzak7U0FkEPLoMoLCcZ9pkPzxgF1NqPCVveUjau90kgnKqwojyy0yMciHFtAfmRlakqRPC3AO3Fztk+Y/fwdYb3NDDhZ75reBM0jMN8ChblkOpvAHJWE/WQ4yvbOJQ34= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=der-flo.net; spf=pass smtp.mailfrom=der-flo.net; arc=none smtp.client-ip=193.160.39.236 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=der-flo.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=der-flo.net From: Florian Lehner To: bpf@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, adrian.hunter@intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Lehner Subject: [PATCH bpf-next] perf/bpf: Fix duplicate type check Date: Sat, 20 Jan 2024 16:09:20 +0100 Message-ID: <20240120150920.3370-1-dev@der-flo.net> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Remove the duplicate check on type and unify result. Signed-off-by: Florian Lehner --- kernel/events/core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index f0f0f71213a1..5ecfa57e3b97 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -9302,10 +9302,6 @@ void perf_event_bpf_event(struct bpf_prog *prog, { struct perf_bpf_event bpf_event; - if (type <= PERF_BPF_EVENT_UNKNOWN || - type >= PERF_BPF_EVENT_MAX) - return; - switch (type) { case PERF_BPF_EVENT_PROG_LOAD: case PERF_BPF_EVENT_PROG_UNLOAD: @@ -9313,7 +9309,7 @@ void perf_event_bpf_event(struct bpf_prog *prog, perf_event_bpf_emit_ksymbols(prog, type); break; default: - break; + return; } if (!atomic_read(&nr_bpf_events)) -- 2.39.2