From patchwork Tue Jan 16 17:20:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 861785 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="JCSnt1/N"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zLcSV0KNmz9t6N for ; Wed, 17 Jan 2018 04:20:58 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751112AbeAPRUx (ORCPT ); Tue, 16 Jan 2018 12:20:53 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:43356 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750876AbeAPRUv (ORCPT ); Tue, 16 Jan 2018 12:20:51 -0500 Received: by mail-it0-f66.google.com with SMTP id u62so5753186ita.2 for ; Tue, 16 Jan 2018 09:20:51 -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=d3qLS/5oik2rvOo53xyrW0DlATNQt5y9Yi7hIBVfhsw=; b=JCSnt1/N2XQpGFJZOy0ieuoIn2KAPCwIZyO/KzKH1Lx7yMCwCNzsRoB1q0o4fgH7zG lR2i9LWQWcAZcCEUiPDKaLHsfZ0xzufbKqh3TWHqRtgvUb/vc5oQh51uYmK455Uin4fj laTRP1lsTjps4H662rCRiqruZ8zSLhcoIu4Ub4mUhAkGAKjDBiMTgKqpb/TZ3sRTqKIj Of2ZhjS7AM3u8PnGFg4TVsq42yu9dIidZ0b2OYrmvMtoTIh1Qk+rY6McNh0gkiq9haOv tZ96jIMmzMfnV8fQuLRhCd2EOb9H8UAtmpl/MfYa5qizYS0iH2lEgSBNKsU81+vvB8Ow K6aA== 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=d3qLS/5oik2rvOo53xyrW0DlATNQt5y9Yi7hIBVfhsw=; b=ZD0MbfBuYiIxcCMP77qc+2cfQGlufR2CwlSWJBzgRaddWO7mQC37iuqfg9Sf8QSzI3 IvujPg9m3Rn2qygg+/n1K1Ioa55q7GHgFksrLtb7maGYsXUAAbbed+IIyX/xrh9+hQUp tXzQoe4KP/Him6mlSKTBWOu/5DL+yzP06HB6l/2e9TrutnX13Skq3oy3UyX9KILo+Gda ptfdnPSVXPyxE38kDo55jFnBFqmeZTxnfB4QmrdJ0rOPHmwVfJ63+pUBQHbP7MvTmSBF 6yu6LwytTe/S+U/JGRn8oNy6IdZzay+sGrXPVnK3bplsh8mU1iLMraX3Pf1swiUMltVH qYow== X-Gm-Message-State: AKwxytev0mjOoQELSZY+5emQrPfbC/7IKdx/o+aeqgbWalqd8AyHCRUp kiWsqpZCHF2QEzsCoQdjIQxLpw== X-Google-Smtp-Source: ACJfBoseVMRwQzmXOXfzdCar2BPVNnl6PTgI4xIKZr4timYjN/eiBpGV/C3yXhId3PdU38CLRixKGA== X-Received: by 10.36.142.70 with SMTP id h67mr15320725ite.6.1516123250726; Tue, 16 Jan 2018 09:20:50 -0800 (PST) Received: from x220t.lan ([64.26.149.125]) by smtp.gmail.com with ESMTPSA id a13sm1353124itj.33.2018.01.16.09.20.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jan 2018 09:20:50 -0800 (PST) From: Alexander Aring To: jhs@mojatatu.com Cc: xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, netdev@vger.kernel.org, kernel@mojatatu.com, Alexander Aring Subject: [PATCH net-next 1/8] net: sched: cls: fix code style issues Date: Tue, 16 Jan 2018 12:20:20 -0500 Message-Id: <20180116172027.22128-2-aring@mojatatu.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180116172027.22128-1-aring@mojatatu.com> References: <20180116172027.22128-1-aring@mojatatu.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch changes some code style issues pointed out by checkpatch inside the TC cls subsystem. Signed-off-by: Alexander Aring --- include/net/sch_generic.h | 3 ++- net/sched/cls_api.c | 2 +- net/sched/cls_matchall.c | 2 +- net/sched/cls_u32.c | 8 ++++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index ac029d5d88e4..b6ca86a8caeb 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -233,7 +233,8 @@ struct tcf_proto_ops { struct tcf_proto*, unsigned long, u32 handle, struct nlattr **, void **, bool); - int (*delete)(struct tcf_proto*, void *, bool*); + int (*delete)(struct tcf_proto *tp, void *arg, + bool *last); void (*walk)(struct tcf_proto*, struct tcf_walker *arg); void (*bind_class)(void *, u32, unsigned long); diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 6708b6953bfa..01d09055707d 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -780,7 +780,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, parent = q->handle; } else { q = qdisc_lookup(dev, TC_H_MAJ(t->tcm_parent)); - if (q == NULL) + if (!q) return -EINVAL; } diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c index 66d4e0099158..634114111adf 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -202,7 +202,7 @@ static int mall_change(struct net *net, struct sk_buff *in_skb, goto err_set_parms; if (!tc_skip_hw(new->flags)) { - err = mall_replace_hw_filter(tp, new, (unsigned long) new); + err = mall_replace_hw_filter(tp, new, (unsigned long)new); if (err) goto err_replace_hw_filter; } diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 507859cdd1cb..2e1b4580f798 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -782,7 +782,7 @@ static int u32_set_parms(struct net *net, struct tcf_proto *tp, if (handle) { ht_down = u32_lookup_ht(ht->tp_c, handle); - if (ht_down == NULL) + if (!ht_down) return -EINVAL; ht_down->refcnt++; } @@ -906,7 +906,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, size_t size; #endif - if (opt == NULL) + if (!opt) return handle ? -EINVAL : 0; err = nla_parse_nested(tb, TCA_U32_MAX, opt, u32_policy, NULL); @@ -1010,7 +1010,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, htid = ht->handle; } else { ht = u32_lookup_ht(tp->data, TC_U32_HTID(htid)); - if (ht == NULL) + if (!ht) return -EINVAL; } } else { @@ -1022,7 +1022,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, return -EINVAL; if (handle) { - if (TC_U32_HTID(handle) && TC_U32_HTID(handle^htid)) + if (TC_U32_HTID(handle) && TC_U32_HTID(handle ^ htid)) return -EINVAL; handle = htid | TC_U32_NODE(handle); err = idr_alloc_ext(&ht->handle_idr, NULL, NULL,