dmraid/dmraid_fixup_nvidia.diff

87 lines
3.2 KiB
Diff

diff -pur dmraid/1.0.0.rc11.orig/lib/datastruct/byteorder.h dmraid/1.0.0.rc11/lib/datastruct/byteorder.h
--- dmraid/1.0.0.rc11.orig/lib/datastruct/byteorder.h 2006-05-12 14:57:41.000000000 +0200
+++ dmraid/1.0.0.rc11/lib/datastruct/byteorder.h 2006-08-10 16:12:05.000000000 +0200
@@ -18,28 +18,28 @@
static inline uint64_t le64_to_cpu(uint64_t x)
{
- return((((uint64_t)x & 0x00000000000000ffULL) << 56) |
- (((uint64_t)x & 0x000000000000ff00ULL) << 40) |
- (((uint64_t)x & 0x0000000000ff0000ULL) << 24) |
- (((uint64_t)x & 0x00000000ff000000ULL) << 8) |
- (((uint64_t)x & 0x000000ff00000000ULL) >> 8) |
- (((uint64_t)x & 0x0000ff0000000000ULL) >> 24) |
- (((uint64_t)x & 0x00ff000000000000ULL) >> 40) |
- (((uint64_t)x & 0xff00000000000000ULL) >> 56));
+ return((((uint64_t)(x) & 0x00000000000000ffULL) << 56) |
+ (((uint64_t)(x) & 0x000000000000ff00ULL) << 40) |
+ (((uint64_t)(x) & 0x0000000000ff0000ULL) << 24) |
+ (((uint64_t)(x) & 0x00000000ff000000ULL) << 8) |
+ (((uint64_t)(x) & 0x000000ff00000000ULL) >> 8) |
+ (((uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) |
+ (((uint64_t)(x) & 0x00ff000000000000ULL) >> 40) |
+ (((uint64_t)(x) & 0xff00000000000000ULL) >> 56));
}
static inline int32_t le32_to_cpu(int32_t x)
{
- return((((u_int32_t)x & 0x000000ffU) << 24) |
- (((u_int32_t)x & 0x0000ff00U) << 8) |
- (((u_int32_t)x & 0x00ff0000U) >> 8) |
- (((u_int32_t)x & 0xff000000U) >> 24));
+ return((((u_int32_t)(x) & 0x000000ffU) << 24) |
+ (((u_int32_t)(x) & 0x0000ff00U) << 8) |
+ (((u_int32_t)(x) & 0x00ff0000U) >> 8) |
+ (((u_int32_t)(x) & 0xff000000U) >> 24));
}
static inline int16_t le16_to_cpu(int16_t x)
{
- return((((u_int16_t)x & 0x00ff) << 8) |
- (((u_int16_t)x & 0xff00) >> 8));
+ return((((u_int16_t)(x) & 0x00ff) << 8) |
+ (((u_int16_t)(x) & 0xff00) >> 8));
}
#define CVT64(x) do { x = le64_to_cpu(x); } while(0)
Nur in dmraid/1.0.0.rc11/lib/datastruct: byteorder.h~.
diff -pur dmraid/1.0.0.rc11.orig/lib/format/ataraid/nv.c dmraid/1.0.0.rc11/lib/format/ataraid/nv.c
--- dmraid/1.0.0.rc11.orig/lib/format/ataraid/nv.c 2006-03-23 13:33:00.000000000 +0100
+++ dmraid/1.0.0.rc11/lib/format/ataraid/nv.c 2006-08-10 16:20:07.000000000 +0200
@@ -151,7 +151,7 @@ static int set_sort(struct list_head *po
static void to_cpu(void *meta)
{
struct nv *nv = meta;
- unsigned int i = NV_SIGNATURES;
+ unsigned int i;
struct nv_array_base *array = &nv->array;
CVT32(nv->size);
@@ -162,7 +162,7 @@ static void to_cpu(void *meta)
CVT32(nv->unitFlags);
CVT32(array->version);
- while (i--);
+ for (i = 0; i < NV_SIGNATURES; i++);
CVT32(array->signature[i]);
CVT32(array->raidLevel);
@@ -221,15 +221,9 @@ static struct raid_dev *nv_read(struct l
static int nv_write(struct lib_context *lc, struct raid_dev *rd, int erase)
{
int ret;
-#if BYTE_ORDER != LITTLE_ENDIAN
- struct nv *nv = META(rd, nv);
- to_disk(nv);
-#endif
ret = write_metadata(lc, handler, rd, -1, erase);
-#if BYTE_ORDER != LITTLE_ENDIAN
- to_cpu(nv);
-#endif
+
return ret;
}
Nur in dmraid/1.0.0.rc11/lib/format/ataraid: nv.c~.