From: David Miller <davem@davemloft.net>
To: rdreier@cisco.com
Cc: divy@chelsio.com, jeff@garzik.org, netdev@vger.kernel.org
Subject: Re: cxgb3: Fix sparse warning and micro-optimize is_pure_response()
Date: Fri, 28 Nov 2008 21:55:48 -0800 (PST) [thread overview]
Message-ID: <20081128.215548.201883857.davem@davemloft.net> (raw)
In-Reply-To: <ada3ahbccdk.fsf@cisco.com>
From: Roland Dreier <rdreier@cisco.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@cisco.com>
Applied, thanks Roland.
prev parent reply other threads:[~2008-11-29 5:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-29 5:47 cxgb3: Fix sparse warning and micro-optimize is_pure_response() Roland Dreier
2008-11-29 5:55 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081128.215548.201883857.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=divy@chelsio.com \
--cc=jeff@garzik.org \
--cc=netdev@vger.kernel.org \
--cc=rdreier@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox