[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20081128.215548.201883857.davem@davemloft.net>
Date: Fri, 28 Nov 2008 21:55:48 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: rdreier@...co.com
Cc: divy@...lsio.com, jeff@...zik.org, netdev@...r.kernel.org
Subject: Re: cxgb3: Fix sparse warning and micro-optimize is_pure_response()
From: Roland Dreier <rdreier@...co.com>
Date: Fri, 28 Nov 2008 21:47:03 -0800
> The function is_pure_response() does "ntohl(var) & const" and then
> essentially just tests whether the result is 0 or not; this can be done
> more efficiently by computing "var & htonl(const)" instead and doing the
> byte swap at compile time instead of run time.
>
> This change slightly shrinks the compiled code; eg on x86-64 we save a
> couple of bswapl instructions:
>
> add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8 (-8)
> function old new delta
> t3_sge_intr_msix_napi 544 536 -8
>
> and this also has the pleasant side effect of fixing a sparse warning:
>
> drivers/net/cxgb3/sge.c:2313:15: warning: restricted degrades to integer
>
> Signed-off-by: Roland Dreier <rolandd@...co.com>
Applied, thanks Roland.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists