Flexible I/O Tester development
 help / color / mirror / Atom feed
* [PATCH] Fix big endian build
@ 2011-11-07 11:44 Anton Blanchard
  2011-11-07 13:15 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Blanchard @ 2011-11-07 11:44 UTC (permalink / raw)
  To: fio


I get the following error when building fio on PowerPC:

client.c: In function ‘convert_agg’:
client.c:641:22: error: invalid operands to binary & (have ‘long double’ and ‘long long unsigned int’)

It looks like we have things backwards, we should byteswap the
integer value before we convert it to a double.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

diff --git a/client.c b/client.c
index a61bc80..f167549 100644
--- a/client.c
+++ b/client.c
@@ -638,7 +638,7 @@ static void convert_agg(struct disk_util_agg *agg)
 	agg->io_ticks		= le32_to_cpu(agg->io_ticks);
 	agg->time_in_queue	= le32_to_cpu(agg->time_in_queue);
 	agg->slavecount		= le32_to_cpu(agg->slavecount);
-	agg->max_util.u.f	= __le64_to_cpu(fio_uint64_to_double(agg->max_util.u.i));
+	agg->max_util.u.f	= fio_uint64_to_double(__le64_to_cpu(agg->max_util.u.i));
 }
 
 static void convert_dus(struct disk_util_stat *dus)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix big endian build
  2011-11-07 11:44 [PATCH] Fix big endian build Anton Blanchard
@ 2011-11-07 13:15 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2011-11-07 13:15 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: fio

On 2011-11-07 12:44, Anton Blanchard wrote:
> 
> I get the following error when building fio on PowerPC:
> 
> client.c: In function ‘convert_agg’:
> client.c:641:22: error: invalid operands to binary & (have ‘long double’ and ‘long long unsigned int’)
> 
> It looks like we have things backwards, we should byteswap the
> integer value before we convert it to a double.

Face palm, thanks Anton, applied.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-07 13:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07 11:44 [PATCH] Fix big endian build Anton Blanchard
2011-11-07 13:15 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox