libnvdimm: Fix endian conversion issues 
[linux-2.6-microblaze.git] / drivers / nvdimm / namespace_devs.c
index 4340132..cca0a3b 100644 (file)
@@ -1987,7 +1987,7 @@ static struct device *create_namespace_pmem(struct nd_region *nd_region,
                nd_mapping = &nd_region->mapping[i];
                label_ent = list_first_entry_or_null(&nd_mapping->labels,
                                typeof(*label_ent), list);
-               label0 = label_ent ? label_ent->label : 0;
+               label0 = label_ent ? label_ent->label : NULL;
 
                if (!label0) {
                        WARN_ON(1);
@@ -2322,8 +2322,9 @@ static struct device **scan_labels(struct nd_region *nd_region)
                        continue;
 
                /* skip labels that describe extents outside of the region */
-               if (nd_label->dpa < nd_mapping->start || nd_label->dpa > map_end)
-                       continue;
+               if (__le64_to_cpu(nd_label->dpa) < nd_mapping->start ||
+                   __le64_to_cpu(nd_label->dpa) > map_end)
+                               continue;
 
                i = add_namespace_resource(nd_region, nd_label, devs, count);
                if (i < 0)