From patchwork Wed Dec 3 08:50:06 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarek Poplawski X-Patchwork-Id: 11908 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id D06ADDDDF0 for ; Wed, 3 Dec 2008 19:50:18 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751392AbYLCIuP (ORCPT ); Wed, 3 Dec 2008 03:50:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751283AbYLCIuO (ORCPT ); Wed, 3 Dec 2008 03:50:14 -0500 Received: from ug-out-1314.google.com ([66.249.92.169]:40496 "EHLO ug-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750876AbYLCIuN (ORCPT ); Wed, 3 Dec 2008 03:50:13 -0500 Received: by ug-out-1314.google.com with SMTP id 39so3323430ugf.37 for ; Wed, 03 Dec 2008 00:50:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=qYr7VbeLhH+MVUqKmzGEEJqf39AAEWnxVjYY56KgkjQ=; b=JMtkdxeRToZdJ40kquksarczImSdso6Pr/u+awqmY1Q5Ajh6v0KMGRDMWoQVTzM72I epBAkzhhQQbH4zkIooDL4wus3K2UerQPfqa4ij4esiL6BXFY+EH7Mf8FuDZySJb/KyGs iiXOxtuDcX7vY9KrRO47qgRyvF86cl0sIdb6E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=BPU4M6yUpONWTbkwlwdRnfMH1PWxG7G2lWyIVAgOJWilQVP2fgZsrm3X2KlL8TZpk0 9N68aun6W2HwowKE/bYnQdNRSAIJGynd0f+XVlMP4T9DGuz1VrpPv/RJcmFv3e5uKn3j Egh5AOUdSYLIBrgrS6p5W6OT77kpmt6EtNBAs= Received: by 10.67.115.14 with SMTP id s14mr1524814ugm.57.1228294210811; Wed, 03 Dec 2008 00:50:10 -0800 (PST) Received: from ff.dom.local (bv170.internetdsl.tpnet.pl [80.53.205.170]) by mx.google.com with ESMTPS id m1sm13851569uge.20.2008.12.03.00.50.09 (version=SSLv3 cipher=RC4-MD5); Wed, 03 Dec 2008 00:50:10 -0800 (PST) Date: Wed, 3 Dec 2008 08:50:06 +0000 From: Jarek Poplawski To: David Miller Cc: devik@cdi.cz, kaber@trash.net, netdev@vger.kernel.org Subject: Re: [PATCH 4/3 v3] pkt_sched: sch_htb: Clean L2T() Message-ID: <20081203085006.GA15262@ff.dom.local> References: <20081203070947.GA5598@ff.dom.local> <20081202.232522.108544572.davem@davemloft.net> <20081203075433.GA7137@ff.dom.local> <20081203.002046.153795689.davem@davemloft.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20081203.002046.153795689.davem@davemloft.net> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Dec 03, 2008 at 12:20:46AM -0800, David Miller wrote: ... > You misunderstood me. > > I meant get rid of L2T completely, and just use > "qdisc_l2t(rate, size)" directly. > > Macros like this one: > > 1) are used in only one spot > 2) give no new information to the reader > > so are just extra noise. Hmm.. I think L2T is special in sched, but no problem... Thanks for the explanation, Jarek P. ------------------> (take 3) pkt_sched: sch_htb: Remove L2T() L2T() is currently used only in one place (and has one spurious parameter, btw), so let's: 'get rid of L2T completely, and just use "qdisc_l2t(rate, size)" directly.' - quote & feedback from David S. Miller. Signed-off-by: Jarek Poplawski --- net/sched/sch_htb.c | 9 +-------- 1 files changed, 1 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 80cb94d..fcd06e2 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -125,13 +125,6 @@ struct htb_class { psched_time_t t_c; /* checkpoint time */ }; -static inline long L2T(struct htb_class *cl, struct qdisc_rate_table *rate, - int size) -{ - long result = qdisc_l2t(rate, size); - return result; -} - struct htb_sched { struct Qdisc_class_hash clhash; struct list_head drops[TC_HTB_NUMPRIO];/* active leaves (for drops) */ @@ -604,7 +597,7 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl, #define HTB_ACCNT(T,B,R) toks = diff + cl->T; \ if (toks > cl->B) toks = cl->B; \ - toks -= L2T(cl, cl->R, bytes); \ + toks -= (long) qdisc_l2t(cl->R, bytes); \ if (toks <= -cl->mbuffer) toks = 1-cl->mbuffer; \ cl->T = toks