From: Antonio Quartulli <ordex@autistici.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCHv3] batman-adv: use __constant_htons when possible
Date: Sun, 19 May 2013 12:27:14 +0200 [thread overview]
Message-ID: <20130519102714.GM3350@ritirata.org> (raw)
In-Reply-To: <1368778903-2289-1-git-send-email-ordex@autistici.org>
[-- Attachment #1: Type: text/plain, Size: 803 bytes --]
On Fri, May 17, 2013 at 10:21:43AM +0200, Antonio Quartulli wrote:
> When comparing a network ordered value with a constant, it
> is better to convert the constant at compile time by means
> of __constant_htons() instead of converting the value at
> runtime using ntohs().
>
> This refactoring may slightly improve the code performance.
>
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
After discussing with Simon, we realised that using __constant_htons is useless
since htons is smart enough to be as efficient as his brother __constant*.
Therefore this patch will be re-arranged to use htons only.
It will still remove some ntohs and make use of htons at their place.
Cheers,
--
Antonio Quartulli
..each of us alone is worth nothing..
Ernesto "Che" Guevara
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2013-05-19 10:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-17 8:21 [B.A.T.M.A.N.] [PATCHv3] batman-adv: use __constant_htons when possible Antonio Quartulli
2013-05-19 10:27 ` Antonio Quartulli [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=20130519102714.GM3350@ritirata.org \
--to=ordex@autistici.org \
--cc=b.a.t.m.a.n@lists.open-mesh.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