libnvdimm, btt: sparse fix
authorDan Williams <dan.j.williams@intel.com>
Sat, 11 Jul 2015 14:02:46 +0000 (10:02 -0400)
committerDan Williams <dan.j.williams@intel.com>
Tue, 28 Jul 2015 02:53:19 +0000 (22:53 -0400)
Fix:
drivers/nvdimm/btt.c:635:29: warning: restricted __le64 degrades to integer

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/btt.c

index 411c7b2bb37aec98e6cdcf5995231f967fd62b0c..552f1c4f4dc6cc84f1c6b1f5b519bfb028c0b6ef 100644 (file)
@@ -632,8 +632,9 @@ static void parse_arena_meta(struct arena_info *arena, struct btt_sb *super,
        arena->logoff = arena_off + le64_to_cpu(super->logoff);
        arena->info2off = arena_off + le64_to_cpu(super->info2off);
 
-       arena->size = (super->nextoff > 0) ? (le64_to_cpu(super->nextoff)) :
-                       (arena->info2off - arena->infooff + BTT_PG_SIZE);
+       arena->size = (le64_to_cpu(super->nextoff) > 0)
+               ? (le64_to_cpu(super->nextoff))
+               : (arena->info2off - arena->infooff + BTT_PG_SIZE);
 
        arena->flags = le32_to_cpu(super->flags);
 }