Skip to content

Commit a9eb49c

Browse files
rddunlapaxboe
authored andcommitted
block: sed-opal: fix sparse warning: convert __be64 data
sparse warns about incorrect type when using __be64 data. It is not being converted to CPU-endian but it should be. Fixes these sparse warnings: ../block/sed-opal.c:375:20: warning: incorrect type in assignment (different base types) ../block/sed-opal.c:375:20: expected unsigned long long [usertype] align ../block/sed-opal.c:375:20: got restricted __be64 const [usertype] alignment_granularity ../block/sed-opal.c:376:25: warning: incorrect type in assignment (different base types) ../block/sed-opal.c:376:25: expected unsigned long long [usertype] lowest_lba ../block/sed-opal.c:376:25: got restricted __be64 const [usertype] lowest_aligned_lba Fixes: 455a7b2 ("block: Add Sed-opal library") Cc: Scott Bauer <[email protected]> Cc: Rafael Antognolli <[email protected]> Cc: [email protected] Reviewed-by: Jon Derrick <[email protected]> Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent dc30102 commit a9eb49c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

block/sed-opal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ static void check_geometry(struct opal_dev *dev, const void *data)
372372
{
373373
const struct d0_geometry_features *geo = data;
374374

375-
dev->align = geo->alignment_granularity;
376-
dev->lowest_lba = geo->lowest_aligned_lba;
375+
dev->align = be64_to_cpu(geo->alignment_granularity);
376+
dev->lowest_lba = be64_to_cpu(geo->lowest_aligned_lba);
377377
}
378378

379379
static int execute_step(struct opal_dev *dev,

0 commit comments

Comments
 (0)