From f53308110bc715c1ce8de2cc4334ff4b72677cbc Mon Sep 17 00:00:00 2001 From: sos Date: Fri, 17 Nov 2006 11:13:47 +0000 Subject: Deal more generically with the byteswap needed on !littleendian HW. Account for the odd layout on ARM bigendian HW. --- sys/dev/ata/ata-all.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index bdf1eed..c25ac82 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -601,12 +601,12 @@ ata_getparam(struct ata_device *atadev, int init) isprint(atadev->param.model[1]))) { struct ata_params *atacap = &atadev->param; char buffer[64]; -#if BYTE_ORDER == BIG_ENDIAN +#ifndef __ARMEB__ int16_t *ptr; for (ptr = (int16_t *)atacap; ptr < (int16_t *)atacap + sizeof(struct ata_params)/2; ptr++) { - *ptr = bswap16(*ptr); + *ptr = le16toh(*ptr); } #endif if (!(!strncmp(atacap->model, "FX", 2) || -- cgit v1.1