Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3793753ybt; Tue, 23 Jun 2020 10:51:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzixCTsJsRRGi3qnE3ebDQiuXrsRIx3bYSlIKatyJhv7ApdELt+8dryNwOGV8AnLssOonuj X-Received: by 2002:a50:e8c6:: with SMTP id l6mr22355740edn.276.1592934680633; Tue, 23 Jun 2020 10:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592934680; cv=none; d=google.com; s=arc-20160816; b=djACCJdjkEmVis19flvvjBCPj9u0C7eIZDVi7tk9yyeUT2UXr/lnGvohvhhRDn6p4H fqdL1N/StcWgiOWcN6w8+4QpvoebDdvJk848v/7nac0fOJRHsnxtoq49lU4ce4TolZ1w dMRQXLgRkZqxAGJcg9nZBdwvzPTwxhsikfERMtuGP+WQE47qiscbLoMn9qIgXXcLVEAk FRxVES345ki46BLGVcCV7FT74otj7w8GEa6gwhQUjw/1mr+7kU9IXtJf1+Zd5eObPhfZ Bu7EV1CUwqXm6k/lih9jqo8DXkaOvPjbuy6IrYSQ/ZMvVM9ztuZdT8WWvU4Kyro1WPsa 5NXg== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=8cfv0Cil1khcQKnkjQhrpBgHiVbTl1eQxEluk1MKgoQ=; b=XLRgN9L/uqsvdi5UFud63aF7UV3qxXCRZhPHkjlFV8rTOcAsvkKmq+BogpwV+tMWsy +d0Vavt4/R30AlTsz4nRGxrLNg55SgCYO76bny7IhBq6b3J6jrIeGUnaMVB0rpl0jki6 sXvVi/lneiKBqtINzFxcGJpc0VkzEZouwAu9N8I5K3uD++1QS7Eoiq5FpB1wwbRky03N Wquo6YrSEssnKxvJfnyzTKv1Se4fdQtn6uRO5P0kzo+z5haoKeztoSID3CCdZpVqv1mz O7gXebmACeQCJkCKTMreB7uZImOyUyyhLDRwakXygBbHvxygOOR/oKx6/38JBOYSlALv aL4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hTXyo9TW; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si5317140edy.187.2020.06.23.10.50.57; Tue, 23 Jun 2020 10:51:20 -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=@redhat.com header.s=mimecast20190719 header.b=hTXyo9TW; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733160AbgFWRui (ORCPT + 99 others); Tue, 23 Jun 2020 13:50:38 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:46889 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732549AbgFWRuh (ORCPT ); Tue, 23 Jun 2020 13:50:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592934636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8cfv0Cil1khcQKnkjQhrpBgHiVbTl1eQxEluk1MKgoQ=; b=hTXyo9TWZ+IyAwsI+9ed4arVV7q3/fdY+CRW9s2s+mSeu7DSBEtH5pj/stdt7+h2jwfPn1 Rtgv6CCKroLxs6/1uGkKG3XMz1R93ktEMMIJzEj+gzsVjYDVWwwGu6Is1ZLj50TTyztiTv N9j/d187GlNo4ElfJn6NR9qiSoBKb8g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-4-bWRygtN2NeepGnJKbcCMYw-1; Tue, 23 Jun 2020 13:50:34 -0400 X-MC-Unique: bWRygtN2NeepGnJKbcCMYw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 498DA800597; Tue, 23 Jun 2020 17:50:33 +0000 (UTC) Received: from ovpn-114-234.ams2.redhat.com (ovpn-114-234.ams2.redhat.com [10.36.114.234]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F8735C1D4; Tue, 23 Jun 2020 17:50:31 +0000 (UTC) Message-ID: <7e7ee41bc1c4c714eae7df10dddb5eb20ed51912.camel@redhat.com> Subject: Re: [PATCH v2 net-next 1/2] indirect_call_wrapper: extend indirect wrapper to support up to 4 calls From: Paolo Abeni To: Brian Vazquez , Brian Vazquez , Eric Dumazet , "David S . Miller" Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Date: Tue, 23 Jun 2020 19:50:30 +0200 In-Reply-To: <20200623164232.175846-1-brianvv@google.com> References: <20200623164232.175846-1-brianvv@google.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.3 (3.36.3-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-06-23 at 09:42 -0700, Brian Vazquez wrote: > 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 Acked-by: Paolo Abeni