From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754005AbdK1Vid (ORCPT ); Tue, 28 Nov 2017 16:38:33 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:55868 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752755AbdK1Vdd (ORCPT ); Tue, 28 Nov 2017 16:33:33 -0500 From: Matthew Wilcox Cc: Matthew Wilcox , Chris Mi , Jiri Pirko , "David S . Miller" , Cong Wang , Jamal Hadi Salim , Daniel Borkmann , Eric Biggers , Lai Jiangshan , Tejun Heo , Rehas Sachdeva , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/17] cls_u32: Convert to idr_alloc_u32 Date: Tue, 28 Nov 2017 13:33:09 -0800 Message-Id: <20171128213312.28983-15-willy@infradead.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171128213312.28983-1-willy@infradead.org> References: <20171128213312.28983-1-willy@infradead.org> To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox No real benefit to this classifier, but since we're allocating a u32 anyway, we should use this function. Signed-off-by: Matthew Wilcox --- net/sched/cls_u32.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index e65b47483dc0..2fede6a55d04 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -970,8 +970,8 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, return -ENOMEM; } } else { - err = idr_alloc_ext(&tp_c->handle_idr, ht, NULL, - handle, handle + 1, GFP_KERNEL); + err = idr_alloc_u32(&tp_c->handle_idr, ht, &handle, + handle, GFP_KERNEL); if (err) { kfree(ht); return err; @@ -1020,8 +1020,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, 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, - handle, handle + 1, + err = idr_alloc_u32(&ht->handle_idr, NULL, &handle, handle, GFP_KERNEL); if (err) return err; -- 2.15.0