From patchwork Thu Feb 15 15:54:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 873968 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="LhAuuawK"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zj19V6J57z9t1t for ; Fri, 16 Feb 2018 02:56:46 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425377AbeBOP4p (ORCPT ); Thu, 15 Feb 2018 10:56:45 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:45745 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424942AbeBOP4D (ORCPT ); Thu, 15 Feb 2018 10:56:03 -0500 Received: by mail-io0-f195.google.com with SMTP id p188so1040406ioe.12 for ; Thu, 15 Feb 2018 07:56:03 -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=LhAuuawKYGJYVuR200BxPgvnqSFJgKVKAHJxjFyV1T7kZ6WlwGKFcKWcPxr6cFNy0W chVhmSFLJtBq3RRqUx/rRRNpXa6V+eYctdTn2vMHMcd8khzsyzsXSNH4K/OE4wXQSjIV jklQ/FtuyFSBgNtDLfLRUJTCoIeSu7zPR6wFmXCBLx2hUHkwZQ8qfiicm9UFIcI9w3xE ZN+++59ZD1NvlW1lFS2JwcwK5zEnQuIH1mUfvgHfc/T2RfVVP45JxKkm/ETWulkqbPkQ 8HvIMn8fbdz8xRYEavWvpn9meHdtvNz/bhJSYT/MWnitARzxLYAO3c2xhII8aTAsc6hu xfKw== 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=r+djcmF/huZuIoe2a/BkVKjR5GzTxFYqDN3bXxUMMUqcIBJj2tIARqu/BoeIslge8Z AM5XDquPoY8F6Jl+oYERmhRtDvb2E+oRuGmXE9pq0aDYmlllp8MuR49p4ZY8odHiR5En R4Sm/UVC07600lfq4K20CSwrjxKbwmHBU+cKyKGjC2W9ompxoXd5VdYPOeOJ5HwboUHB RubSYke5GRHaCqcR2UPCXeRzCGXSJbrY0P3jdyW4hOQbSKBYNA2dhVaXAI7Y6VwBH83V bDygeOQIusd+/P2lCX2Gz4veTAqPzkMetGzxUm31WOQG4KNcwn14S7rezkeMDRWSip3z 7VIw== X-Gm-Message-State: APf1xPAIqp96rx6YAQymMjgAk3jKgqd2lcuhkCqfATb9gjIaWdiJccdx 8thCK2DAAdibdFAeGLCfATswXA== X-Google-Smtp-Source: AH8x224iF/xDYJcSE1gUjwNH/NH98q/+L4jBT1xK8fHddMoMTsV6VnliuHfA+HzRLdsDeaoUfo7v/A== X-Received: by 10.107.34.8 with SMTP id i8mr4013370ioi.71.1518710162618; Thu, 15 Feb 2018 07:56:02 -0800 (PST) Received: from x220t.lan ([64.26.149.125]) by smtp.gmail.com with ESMTPSA id h2sm627986ioa.77.2018.02.15.07.56.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 07:56:02 -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, dcaratti@redhat.com, Alexander Aring Subject: [PATCHv3 net-next 1/8] net: sched: act: fix code style Date: Thu, 15 Feb 2018 10:54:53 -0500 Message-Id: <20180215155500.23578-2-aring@mojatatu.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180215155500.23578-1-aring@mojatatu.com> References: <20180215155500.23578-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);