* [PATCH 1/2] pretty_sig: little-endian
@ 2010-12-03 20:40 Jim Rees
0 siblings, 0 replies; only message in thread
From: Jim Rees @ 2010-12-03 20:40 UTC (permalink / raw)
To: Benny Halevy; +Cc: linux-nfs, peter honeyman
From: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Jim Rees <rees@umich.edu>
---
utils/blkmapd/device-process.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/utils/blkmapd/device-process.c b/utils/blkmapd/device-process.c
index ea8b8ec..0d8705f 100644
--- a/utils/blkmapd/device-process.c
+++ b/utils/blkmapd/device-process.c
@@ -58,10 +58,8 @@ static char *pretty_sig(char *sig, uint32_t siglen)
int i;
sigval = 0;
- for (i = 0; i < siglen; i++) {
- sigval <<= 8;
- sigval += ((unsigned char *)sig)[i];
- }
+ for (i = 0; i < siglen; i++)
+ sigval |= ((unsigned char *)sig)[i] << (i * 8);
sprintf(rs, "0x%0llx", sigval);
} else {
if (siglen > sizeof rs - 4) {
--
1.7.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-12-03 20:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-03 20:40 [PATCH 1/2] pretty_sig: little-endian Jim Rees
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).