From: David Miller <davem@davemloft.net>
To: linux@rasmusvillemoes.dk
Cc: jcliburn@gmail.com, chris.snook@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] atheros/atlx: Simplify bit manipulations
Date: Sat, 24 Jan 2015 23:35:40 -0800 (PST) [thread overview]
Message-ID: <20150124.233540.192666118515975126.davem@davemloft.net> (raw)
In-Reply-To: <1422011212-30095-1-git-send-email-linux@rasmusvillemoes.dk>
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Date: Fri, 23 Jan 2015 12:06:52 +0100
> The code 'if (foo & X) foo &= ~X;' is semantically equivalent to
> simply 'foo &= ~X;', but gcc generates about four instructions for the
> former, one for the latter. Similarly, if X consists of a single bit,
> 'if (!(foo & X)) X |= X;' can be replaced by 'foo |= X;'.
>
> In the atl2 case, gcc does know how to merge the new adjacent
> operations, so altogether this gives a nice little code size
> reduction of about 80 bytes.
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
I agree with the feedback given that these open-coded sequences should
be replaced with the appropriate PCI helpers instead of edited
further.
prev parent reply other threads:[~2015-01-25 7:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 11:06 [PATCH] atheros/atlx: Simplify bit manipulations Rasmus Villemoes
2015-01-23 20:26 ` Francois Romieu
2015-01-25 7:35 ` 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=20150124.233540.192666118515975126.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=chris.snook@gmail.com \
--cc=jcliburn@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).