Skip to contentSkip to conversation

Fix big endian build

PATCH In review Anton Blanchard 2 participants 2 messages Nov 7, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix big endian build

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.

---

client.c +1 -1
index a61bc80..f167549 100644
@@ -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)
#1 lore raw
Quoted 8 lines · Anton Blanchard

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.

Signature · 1 line
Jens Axboe