From patchwork Thu Jan 18 16:20:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 863008 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="GKfjJcL1"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zMq3C2Fcsz9s81 for ; Fri, 19 Jan 2018 03:21:43 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933497AbeARQVk (ORCPT ); Thu, 18 Jan 2018 11:21:40 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:34041 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933379AbeARQVM (ORCPT ); Thu, 18 Jan 2018 11:21:12 -0500 Received: by mail-io0-f195.google.com with SMTP id c17so25438923iod.1 for ; Thu, 18 Jan 2018 08:21:12 -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=eOosObxFU3vNlNfUrS9cTpyxg++ZI7vKhK6IDa/XUR0=; b=GKfjJcL10sBfSISN8IXiF+vF+q/gN4cucUXZbxSR/ArAmCI6P/dhAF80FwSOAi97l6 2AA77CCTxCTvaowBz1j+jw0FUYvcWS9z2PBlC+5DsEqYtuehnT0VRuM21a0/69sry0F3 DlKdwhOd714oJ7hecQwFXWK2U78Ave9W2c+NXDLx02etqmU6LpJBUv5goIa+1z+q5G6u oPRjnvTQmK+4c9RPNiU4tKI0JntV5Q19n5NQvZJEKF1LFr/3VNRiHDtW2OirymSHkGFX FkzIs4ZOZ7xGbUeHQYp/9JjCRqKF3gfsKfaFREbwveYKXRHqfjg7dp4ytC8mnIvIO3Pf tECA== 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=eOosObxFU3vNlNfUrS9cTpyxg++ZI7vKhK6IDa/XUR0=; b=IZvE7Wz6/BYUo6UobuvRZj6YZQwn1I0sVt1FoToYE0Km2Kr5FeCLU8X6GKb9XADUJh grDqL9Q7+B9r3+Lh9mpg5Ln6V06QQT7bQknOdATOp7yDuHxwjuu+AmalCDCEw72Wfbyv X9jm4JDMeySAj97nu1nrkvWIFt+256szoqFv9QJ83nLqqMgLZ5xyg1oLo5HKUE47BYzx fLhCHvMwBo9uW5iNqW6+7C57n13IOWHdmqSowc8ja/7m95iVVz8h/lasvmH3NQH0s2Sb CNk/stkqQyzDS9sAdksmceEfeKgOJPxeMK6C2OlTPnk105iAVTB8TviAxwWkGRt3s2Qs HM+Q== X-Gm-Message-State: AKwxyte/Necy7mjQ5RfTRgpTde9Rn/kjNmfKB4TqPJS3Ggn1kq3bSGw+ PMAKnuw9VYL662Wn1mOTNfBntw== X-Google-Smtp-Source: ACJfBovwFAIQPn19xhnDQtIPiDdIj/W1ZN6F5Bg5MKn6gFFr5Q5Xq8mW5LHkWqm8vDDZwRh9Kcmq/Q== X-Received: by 10.107.212.24 with SMTP id l24mr11509997iog.40.1516292471833; Thu, 18 Jan 2018 08:21:11 -0800 (PST) Received: from x220t.lan ([64.26.149.125]) by smtp.gmail.com with ESMTPSA id k185sm3831890iok.39.2018.01.18.08.21.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 08:21:11 -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, kubakici@wp.pl, Alexander Aring Subject: [PATCHv3 net-next 1/7] net: sched: cls: fix code style issues Date: Thu, 18 Jan 2018 11:20:49 -0500 Message-Id: <20180118162055.31587-2-aring@mojatatu.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180118162055.31587-1-aring@mojatatu.com> References: <20180118162055.31587-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 Acked-by: Jiri Pirko --- include/net/sch_generic.h | 3 ++- net/sched/cls_matchall.c | 2 +- net/sched/cls_u32.c | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index cfc19d0ba2ad..c90f5fe6bed9 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -240,7 +240,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_matchall.c b/net/sched/cls_matchall.c index d0e57c86636f..aeae89eeed0d 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -203,7 +203,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 020d328d0afd..84129b3c14e5 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -783,7 +783,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++; } @@ -907,7 +907,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); @@ -1011,7 +1011,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 { @@ -1023,7 +1023,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,