From: Eyal Lebedinsky <eyal@eyal.emu.id.au>
To: linux-raid@vger.kernel.org
Subject: Re: [PATCH] mdadm 2.5 (Was: ANNOUNCE: mdadm 2.5 - A tool for managing Soft RAID under Linux)
Date: Thu, 01 Jun 2006 08:15:16 +1000 [thread overview]
Message-ID: <447E1574.60908@eyal.emu.id.au> (raw)
In-Reply-To: <20060531171801.56459.qmail@web50208.mail.yahoo.com>
Alex Davis wrote:
>>short swap16(short in)
>>{
>> int i;
>> short out=0;
>> for (i=0; i<4; i++) {
>> out = out<<8 | (in&255);
>> in = in >> 8;
>> }
>> return out;
>>}
>
> Shouldn't that be "for (i=0; i<2; i++) {..." ?
In which case, do we really need this complexity rather than
a clear swap, e.g.
return (short)(((in&0x0ff)<<8) | ((in>>8)&0x0ff))
Simple enough for a macro too.
--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>
attach .zip as .dat
next prev parent reply other threads:[~2006-05-31 22:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-31 17:18 [PATCH] mdadm 2.5 (Was: ANNOUNCE: mdadm 2.5 - A tool for managing Soft RAID under Linux) Alex Davis
2006-05-31 22:15 ` Eyal Lebedinsky [this message]
2006-06-01 1:22 ` Neil Brown
2006-06-01 7:11 ` Luca Berra
-- strict thread matches above, loose matches on Subject: below --
2006-05-26 6:33 ANNOUNCE: mdadm 2.5 - A tool for managing Soft RAID under Linux Neil Brown
2006-05-28 13:32 ` [PATCH] mdadm 2.5 (Was: ANNOUNCE: mdadm 2.5 - A tool for managing Soft RAID under Linux) Luca Berra
2006-05-28 17:08 ` dean gaudet
2006-05-28 17:48 ` Luca Berra
2006-05-28 21:42 ` dean gaudet
2006-05-29 2:08 ` Neil Brown
2006-05-29 5:44 ` Luca Berra
2006-05-29 6:06 ` Neil Brown
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=447E1574.60908@eyal.emu.id.au \
--to=eyal@eyal.emu.id.au \
--cc=linux-raid@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.