From: Simon Horman Subject: [PATCH/RFC 5/8] datapath: Move last_action() helper to datapath.h Date: Thu, 18 Sep 2014 10:52:30 +0900 Message-ID: <1411005153-11041-6-git-send-email-simon.horman@netronome.com> References: <1411005153-11041-1-git-send-email-simon.horman@netronome.com> Cc: Pravin Shelar , Jesse Gross , Thomas Graf , Simon Horman To: dev@openvswtich.org, netdev@vger.kernel.org Return-path: Received: from mail-pa0-f42.google.com ([209.85.220.42]:49299 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757408AbaIRBxA (ORCPT ); Wed, 17 Sep 2014 21:53:00 -0400 Received: by mail-pa0-f42.google.com with SMTP id lj1so337827pab.29 for ; Wed, 17 Sep 2014 18:53:00 -0700 (PDT) In-Reply-To: <1411005153-11041-1-git-send-email-simon.horman@netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: This is in preparation for using last_action() from more than one C file as part of supporting an odp select group action. Signed-off-by: Simon Horman --- datapath/actions.c | 6 ------ datapath/datapath.h | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/datapath/actions.c b/datapath/actions.c index 51ca40b..9d27234 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -752,11 +752,6 @@ static int output_userspace(struct datapath *dp, struct sk_buff *skb, return ovs_dp_upcall(dp, skb, &upcall); } -static bool last_action(const struct nlattr *a, int rem) -{ - return a->nla_len == rem; -} - static int sample(struct datapath *dp, struct sk_buff *skb, const struct nlattr *attr) { @@ -841,7 +836,6 @@ static int select_group(struct datapath *dp, struct sk_buff *skb, const struct nlattr *best_bucket = NULL; const struct nlattr *acts_list; const struct nlattr *bucket; - struct sk_buff *sample_skb; u32 best_score = 0; u32 basis; u32 i = 0; diff --git a/datapath/datapath.h b/datapath/datapath.h index c5d3c86..74a15e6 100644 --- a/datapath/datapath.h +++ b/datapath/datapath.h @@ -209,4 +209,9 @@ do { \ if (net_ratelimit()) \ pr_info("netlink: " fmt, ##__VA_ARGS__); \ } while (0) + +static inline bool last_action(const struct nlattr *a, int rem) +{ + return a->nla_len == rem; +} #endif /* datapath.h */ -- 2.0.1