From patchwork Wed Feb 14 22:13:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 873560 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=mojatatu-com.20150623.gappssmtp.com header.i=@mojatatu-com.20150623.gappssmtp.com header.b="UL/Wr12o"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zhYcP6m8Tz9t32 for ; Thu, 15 Feb 2018 09:15:01 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031806AbeBNWOU (ORCPT ); Wed, 14 Feb 2018 17:14:20 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:35229 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031551AbeBNWOS (ORCPT ); Wed, 14 Feb 2018 17:14:18 -0500 Received: by mail-io0-f195.google.com with SMTP id m11so26796299iob.2 for ; Wed, 14 Feb 2018 14:14:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Nx3nlvzsxz9Tw2HMvd+9Z46BpCkF7GDYMXCwwVJwpCA=; b=UL/Wr12olj+hEcJrCczOlA5RN+TH93rDJK2H2Zuqa6w6zm6NzmtWWqtax4qxbprMk6 0RPJy8+fJmsygwGgXZj1qA4z/KJOHbcViGl6dwvHryp6WNushMf4jhWeuHuHk/5cowEZ 8PSRSumoptimnsm7CSIU7qHIXBzj3NK2mrV0JipozkHeOaUiVVowsjPCT3FeGBNzrlTB npKBf+fdhI8rMFNV0KTr/eXPRX8k5tvUEYJuMOamOsqik+QVOrhxkth2gYLQ4cbFOhxP TJN3UhuEp2YPc1CXl2bFlvPgpf2REZw7JnDYSLYbY4t/Izq6O6tH2g0AoQwaqHuc3sMZ CrWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Nx3nlvzsxz9Tw2HMvd+9Z46BpCkF7GDYMXCwwVJwpCA=; b=JP/HWAv1WDsUIpjorsoB/lLz2Mew/BIdBuryN8R9u2MTbVqUqhLYG8JewdFG962wlS mRq3V4UsGY6wrqm+KGH1dByBTq1YZHMSkCRvcgxP62+pF5zE/g/RXgEDCshMP663HH2A KqkqNbH0AWxAuW3VwINId/i4mXRZYB0hy6x3KIaDIQs52Y0JmVdfDnWFr/xDt9sCdQFB hLdymDPz04pbq/rdyWoYlDRQoVjTLo8cNNJjCEszs5vjQvtQKGzv0I6R0ssbjaz33+YO tjlFFNiOvcXy5hPyIqmvzifTb6so95Wx4dejpK7+GE0j8U4QtqlPvES9sKsbPpp1IMvM 6D2Q== X-Gm-Message-State: APf1xPBenBGXy8pTVB4wzy4tMXuVIOL9/nZfKC3gcHC+6ZVrsqk1w4JV Ajomm1ngSsjgEXCuT+VfxRRYOw== X-Google-Smtp-Source: AH8x226Vi/bkmal1WHiBtsRTKd6WV9pL4qJiTyyTX0RSi7t/QSkCXewbBF/bbheBfvFVGtWqjzagIA== X-Received: by 10.107.148.139 with SMTP id w133mr958786iod.175.1518646457433; Wed, 14 Feb 2018 14:14:17 -0800 (PST) Received: from x220t.lan ([64.26.149.125]) by smtp.gmail.com with ESMTPSA id s24sm1379385ioa.34.2018.02.14.14.14.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 14:14:17 -0800 (PST) From: Alexander Aring To: davem@davemloft.net Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, netdev@vger.kernel.org, kernel@mojatatu.com, Alexander Aring Subject: [PATCHv2 net-next 1/8] net: sched: act: fix code style Date: Wed, 14 Feb 2018 17:13:35 -0500 Message-Id: <20180214221342.24754-2-aring@mojatatu.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180214221342.24754-1-aring@mojatatu.com> References: <20180214221342.24754-1-aring@mojatatu.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch is used by subsequent patches. It fixes code style issues caught by checkpatch. Signed-off-by: Alexander Aring --- include/net/act_api.h | 5 +++-- net/sched/act_api.c | 12 ++++++------ net/sched/act_mirred.c | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/net/act_api.h b/include/net/act_api.h index 6ed9692f20bd..32ef544f4ddc 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -87,12 +87,13 @@ struct tc_action_ops { struct tcf_result *); int (*dump)(struct sk_buff *, struct tc_action *, int, int); void (*cleanup)(struct tc_action *); - int (*lookup)(struct net *, struct tc_action **, u32); + int (*lookup)(struct net *net, struct tc_action **a, u32 index); int (*init)(struct net *net, struct nlattr *nla, struct nlattr *est, struct tc_action **act, int ovr, int bind); int (*walk)(struct net *, struct sk_buff *, - struct netlink_callback *, int, const struct tc_action_ops *); + struct netlink_callback *, int, + const struct tc_action_ops *); void (*stats_update)(struct tc_action *, u64, u32, u64); struct net_device *(*get_dev)(const struct tc_action *a); }; diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 4886ea4a7d6e..becc63689fae 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -621,7 +621,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp, goto err_out; err = -EINVAL; kind = tb[TCA_ACT_KIND]; - if (kind == NULL) + if (!kind) goto err_out; if (nla_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ) goto err_out; @@ -822,7 +822,7 @@ static int tca_get_fill(struct sk_buff *skb, struct list_head *actions, t->tca__pad2 = 0; nest = nla_nest_start(skb, TCA_ACT_TAB); - if (nest == NULL) + if (!nest) goto out_nlmsg_trim; if (tcf_action_dump(skb, actions, bind, ref) < 0) @@ -934,7 +934,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla, t->tca__pad2 = 0; nest = nla_nest_start(skb, TCA_ACT_TAB); - if (nest == NULL) + if (!nest) goto out_module_put; err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops); @@ -1005,10 +1005,10 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n, return ret; if (event == RTM_DELACTION && n->nlmsg_flags & NLM_F_ROOT) { - if (tb[1] != NULL) + if (tb[1]) return tca_action_flush(net, tb[1], n, portid); - else - return -EINVAL; + + return -EINVAL; } for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) { diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index e6ff88f72900..abcd5f12b913 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c @@ -80,12 +80,12 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla, bool exists = false; int ret; - if (nla == NULL) + if (!nla) return -EINVAL; ret = nla_parse_nested(tb, TCA_MIRRED_MAX, nla, mirred_policy, NULL); if (ret < 0) return ret; - if (tb[TCA_MIRRED_PARMS] == NULL) + if (!tb[TCA_MIRRED_PARMS]) return -EINVAL; parm = nla_data(tb[TCA_MIRRED_PARMS]); @@ -117,7 +117,7 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla, } if (!exists) { - if (dev == NULL) + if (!dev) return -EINVAL; ret = tcf_idr_create(tn, parm->index, est, a, &act_mirred_ops, bind, true);