Skip to content

Commit

Permalink
md/md-cluster: fix spares warnings for __le64
Browse files Browse the repository at this point in the history
drivers/md/md-cluster.c:1220:22: warning: incorrect type in assignment (different base types)
drivers/md/md-cluster.c:1220:22:    expected unsigned long my_sync_size
drivers/md/md-cluster.c:1220:22:    got restricted __le64 [usertype] sync_size
drivers/md/md-cluster.c:1252:35: warning: incorrect type in assignment (different base types)
drivers/md/md-cluster.c:1252:35:    expected unsigned long sync_size
drivers/md/md-cluster.c:1252:35:    got restricted __le64 [usertype] sync_size
drivers/md/md-cluster.c:1253:41: warning: restricted __le64 degrades to integer

Fix the warnings by using le64_to_cpu() to convet __le64 to integer.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240826074452.1490072-6-yukuai1@huaweicloud.com
Signed-off-by: Song Liu <song@kernel.org>
  • Loading branch information
Yu Kuai authored and Song Liu committed Aug 27, 2024
1 parent d004442 commit 82697cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/md/md-cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ static int cluster_check_sync_size(struct mddev *mddev)
struct dlm_lock_resource *bm_lockres;

sb = kmap_atomic(bitmap->storage.sb_page);
my_sync_size = sb->sync_size;
my_sync_size = le64_to_cpu(sb->sync_size);
kunmap_atomic(sb);

for (i = 0; i < node_num; i++) {
Expand Down Expand Up @@ -1249,8 +1249,8 @@ static int cluster_check_sync_size(struct mddev *mddev)

sb = kmap_atomic(bitmap->storage.sb_page);
if (sync_size == 0)
sync_size = sb->sync_size;
else if (sync_size != sb->sync_size) {
sync_size = le64_to_cpu(sb->sync_size);
else if (sync_size != le64_to_cpu(sb->sync_size)) {
kunmap_atomic(sb);
md_bitmap_free(bitmap);
return -1;
Expand Down

0 comments on commit 82697cc

Please sign in to comment.