diff options
author | Randy Dunlap <rdunlap@infradead.org> | 2019-10-02 22:23:15 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-10-03 16:21:32 -0400 |
commit | a9eb49c964884654dd6394cb6abe7ceb021c9c96 (patch) | |
tree | ffc078bf0a06584d51307219367ba3be641eaeae | |
parent | dc301025658aef326763765b0bebeaa44569ed20 (diff) |
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: 455a7b238cd6 ("block: Add Sed-opal library")
Cc: Scott Bauer <scott.bauer@intel.com>
Cc: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: linux-block@vger.kernel.org
Reviewed-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | block/sed-opal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/sed-opal.c b/block/sed-opal.c index 59a6ba2131d5..b4c761973ac1 100644 --- a/block/sed-opal.c +++ b/block/sed-opal.c | |||
@@ -372,8 +372,8 @@ static void check_geometry(struct opal_dev *dev, const void *data) | |||
372 | { | 372 | { |
373 | const struct d0_geometry_features *geo = data; | 373 | const struct d0_geometry_features *geo = data; |
374 | 374 | ||
375 | dev->align = geo->alignment_granularity; | 375 | dev->align = be64_to_cpu(geo->alignment_granularity); |
376 | dev->lowest_lba = geo->lowest_aligned_lba; | 376 | dev->lowest_lba = be64_to_cpu(geo->lowest_aligned_lba); |
377 | } | 377 | } |
378 | 378 | ||
379 | static int execute_step(struct opal_dev *dev, | 379 | static int execute_step(struct opal_dev *dev, |