Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3746898ybt; Tue, 23 Jun 2020 09:43:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtBahqKz99M8KmmTvJnNkZLlpUosViLMNXonTYghyWGsnWQsQYLn0gXZgWjUC1hr+LlNdT X-Received: by 2002:a50:ee87:: with SMTP id f7mr3577172edr.355.1592930601236; Tue, 23 Jun 2020 09:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592930601; cv=none; d=google.com; s=arc-20160816; b=rifuVbp04/eS2e8yXI+/toRiZa4uVPIxUdS21/sIkEssVBEI836Jhj7IzYvMWKK3N3 Uqyf3yBo97C7jh6CVE5IyYhW1+W1StN188lsv4sbN8mZWu/gb1tuh7+kUQup4+WY4TfF 8zhBtjbk45ZHBBw1etbAOeITv3EqcwNm7IJZ1ktVZ9rOSV1/cQX/BLUgvpO8eaZ1ywHJ uyd3a0P+ZBQYHStT9n5YNk/uJoDTi+MkSTXDpE4nBKlZfM3GDfK+sIsNkefF+5QkQ5FP aksfsOlPBH8F/bFT1CPMGow2GF1nd89r/nqV/OfPoYMDBuhEtNX9vPa4twXUMSPA5Dne P2Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=zl+PzJjccgQ/z2IEdEeYMiws9NGR4cJmTEy3MFLmC3o=; b=wBkJK5yAaruv4ZXX/tJcmw+cZ13is2CW4X+y0/hPrD/WiSosMvtrkbRVputvMViJVZ S1B9riKAWKiffiYd4zRMuNmOz2n6OsCNarJy10uIDnlHOfRTghZxcGN+ZVQy7bN9HhVf TP6kgYtjE1a88nnfD8vV3Iwc1MsFKQFUMY14jTmfyG14ta7bYPD2RVv/aUvik5eE77xV flZmYhaL0UOSsMMELhWrSm7MGO4xUEiq2Y6lcoC2y64HKGy32y5Ku6tTjU3fFeouStJU /iBf1r4J68iEd1zkSuHRC7jDxRj78nekni2jLe3/3yo4VWlS0psRe3A0bCuf2WWfOa6X gU9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Du2IZQVw; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y24si12044418edu.80.2020.06.23.09.42.50; Tue, 23 Jun 2020 09:43:21 -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=@google.com header.s=20161025 header.b=Du2IZQVw; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732406AbgFWQmi (ORCPT + 99 others); Tue, 23 Jun 2020 12:42:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732174AbgFWQmi (ORCPT ); Tue, 23 Jun 2020 12:42:38 -0400 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2597DC061755 for ; Tue, 23 Jun 2020 09:42:38 -0700 (PDT) Received: by mail-qt1-x84a.google.com with SMTP id z26so9882890qto.15 for ; Tue, 23 Jun 2020 09:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=zl+PzJjccgQ/z2IEdEeYMiws9NGR4cJmTEy3MFLmC3o=; b=Du2IZQVww527r+DkfvLwjzL1rLzDjXpQwn91wkmvUrKnk31COi3wf75uaCGRrhnnGT cZtT9QEs5+WAsDy2Ws+B4BBRNf8YRXN+wx28A81PgSW5nfRRKHGEunysMDByIjthTpU1 EaG+wzyDLq6vv8QEQnsq9NFMy+Ermx4r6wlkGoIVUpdvXVYM35WHVewJAvwnDJayvvIJ LNC+uYqFb6WOk68KVwUZMOQ47eUWbRT7EAHJLRpH8tFbqnw9UwX9DGe3NzzMS8hv6L01 SxMsXa5G4ntXvJFJlJn6ilR1MO/d8wM/CtsQIbsORt7+rG13EysINazUWFLS/0Y592H1 hRRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=zl+PzJjccgQ/z2IEdEeYMiws9NGR4cJmTEy3MFLmC3o=; b=sXeD4NfzRnLAygcyg9j+UOD6g0JUvnLxltslfeR4XAxeET198gFsOpwfdXVvoNkKO+ 2sx52ftUGgvKzmd58GegZR/zw8BVAUfM1lW1pgZg7OGufUPBQlHVjQgz2jyQdTKRO675 eMevJiCXO/kSKc2EEWsi+1t7RrkrRxwVH+kiFQR1BFJKOKRLtcqQ7WfAIi+WVYKjdwjd 8D15mhlRY47JBf45m/jxrMwLJNAfF+t4fdEteILpErSRrlrXpT4ooN7+2/USqGa98CXS vOZPRs95251Qx8x+Tl+05Sk4+DZoivWD7Kzzpwshsad8C7dmFly3QkAuOPN7Dyh61z7H Ru/g== X-Gm-Message-State: AOAM533ynRqfptepVblsVZ6+BKGLOD8ttjhldrTcV4PgvRwx8/+Kjf8b qE1PlLgZZoJ7C431cvszyfXERzf3cmK9 X-Received: by 2002:a0c:bd12:: with SMTP id m18mr16597999qvg.178.1592930557012; Tue, 23 Jun 2020 09:42:37 -0700 (PDT) Date: Tue, 23 Jun 2020 09:42:31 -0700 Message-Id: <20200623164232.175846-1-brianvv@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.27.0.111.gc72c7da667-goog Subject: [PATCH v2 net-next 1/2] indirect_call_wrapper: extend indirect wrapper to support up to 4 calls From: Brian Vazquez To: Brian Vazquez , Brian Vazquez , Eric Dumazet , "David S . Miller" Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are many places where 2 annotations are not enough. This patch adds INDIRECT_CALL_3 and INDIRECT_CALL_4 to cover such cases. Signed-off-by: Brian Vazquez --- include/linux/indirect_call_wrapper.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/indirect_call_wrapper.h b/include/linux/indirect_call_wrapper.h index 00d7e8e919c6..54c02c84906a 100644 --- a/include/linux/indirect_call_wrapper.h +++ b/include/linux/indirect_call_wrapper.h @@ -23,6 +23,16 @@ likely(f == f2) ? f2(__VA_ARGS__) : \ INDIRECT_CALL_1(f, f1, __VA_ARGS__); \ }) +#define INDIRECT_CALL_3(f, f3, f2, f1, ...) \ + ({ \ + likely(f == f3) ? f3(__VA_ARGS__) : \ + INDIRECT_CALL_2(f, f2, f1, __VA_ARGS__); \ + }) +#define INDIRECT_CALL_4(f, f4, f3, f2, f1, ...) \ + ({ \ + likely(f == f4) ? f4(__VA_ARGS__) : \ + INDIRECT_CALL_3(f, f3, f2, f1, __VA_ARGS__); \ + }) #define INDIRECT_CALLABLE_DECLARE(f) f #define INDIRECT_CALLABLE_SCOPE @@ -30,6 +40,8 @@ #else #define INDIRECT_CALL_1(f, f1, ...) f(__VA_ARGS__) #define INDIRECT_CALL_2(f, f2, f1, ...) f(__VA_ARGS__) +#define INDIRECT_CALL_3(f, f3, f2, f1, ...) f(__VA_ARGS__) +#define INDIRECT_CALL_4(f, f4, f3, f2, f1, ...) f(__VA_ARGS__) #define INDIRECT_CALLABLE_DECLARE(f) #define INDIRECT_CALLABLE_SCOPE static #endif -- 2.27.0.111.gc72c7da667-goog