From patchwork Tue Oct 4 09:09:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 12998025 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38212C4332F for ; Tue, 4 Oct 2022 09:10:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230418AbiJDJKI (ORCPT ); Tue, 4 Oct 2022 05:10:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229722AbiJDJKG (ORCPT ); Tue, 4 Oct 2022 05:10:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBC9513D46; Tue, 4 Oct 2022 02:10:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 947EBB81915; Tue, 4 Oct 2022 09:10:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F5E4C433C1; Tue, 4 Oct 2022 09:10:02 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="Z678509s" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1664874600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=0hs1IsEGUyjMwHR9WwV4memFIy/AoaL6RbQhrgEup2Q=; b=Z678509smGM8bP3SS+4I0Ud/8nidvLu/4oLEwSHnqjBVEGYZ/zPA1KzGywhdogUM7cYDkD VoAOZYof5XkRVkYTnhum700euhCfZMtuT1pWFKA0ug9BT6Hob62sOtr3Z2ULGYQimeTXTK BNl0vMaIgzH0hzWQfp/Th9/ZDJTNYRs= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 0c34866b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 4 Oct 2022 09:09:59 +0000 (UTC) From: "Jason A. Donenfeld" To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, kuba@kernel.org Cc: "Jason A. Donenfeld" Subject: [PATCH] bpf: unify function pointer type of dispatcher Date: Tue, 4 Oct 2022 11:09:41 +0200 Message-Id: <20221004090941.1360595-1-Jason@zx2c4.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net The __bpf_prog_run() function takes a bpf_dispatcher_fn as its last argument, which are usually generated by use of the DEFINE_BPF_DISPATCHER() macro. The last argument of a bpf_dispatcher_fn is an open coded function pointer. The DEFINE_BPF_DISPATCHER() macro, on the other hand, has as its last argument a bpf_func_t, rather than an open coded function pointer. Unify these two signatures by using bpf_func_t in both places, since it's the same as the open coded function pointer. Signed-off-by: Jason A. Donenfeld --- include/linux/filter.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/filter.h b/include/linux/filter.h index 527ae1d64e27..25e85cfc28b8 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -569,8 +569,7 @@ DECLARE_STATIC_KEY_FALSE(bpf_stats_enabled_key); typedef unsigned int (*bpf_dispatcher_fn)(const void *ctx, const struct bpf_insn *insnsi, - unsigned int (*bpf_func)(const void *, - const struct bpf_insn *)); + bpf_func_t bpf_func); static __always_inline u32 __bpf_prog_run(const struct bpf_prog *prog, const void *ctx,