The DDF specification, both 1.2 and 2.0 require big-endian.
This is also what mdadm expects.
5.2 Byte Ordering
Each section of the DDF MUST be stored in big-endian format
(i.e., the more significant bytes of the section are stored in
lower addresses in relation to bytes of lesser significance).
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
sizeof(struct ddf_header));
if (!ddf)
return errno ? -errno : 1;
- if (ddf->signature == cpu_to_be32(DDF_MAGIC) ||
- ddf->signature == cpu_to_le32(DDF_MAGIC))
+ if (ddf->signature == cpu_to_be32(DDF_MAGIC))
break;
ddf = NULL;
}
if (!ddf)
return 1;
- lba = ddf->signature == cpu_to_be32(DDF_MAGIC) ?
- be64_to_cpu(ddf->primary_lba) :
- le64_to_cpu(ddf->primary_lba);
+ lba = be64_to_cpu(ddf->primary_lba);
if (lba > 0) {
/* check primary header */