ANDROID: Incremental fs: Fix misuse of cpu_to_leXX and poll return

Found by sparse:

fs/incfs/format.c:416:21: warning: incorrect type in assignment (different base types)
fs/incfs/format.c:416:21:    expected restricted __le32 [assigned] [usertype] fh_flags
fs/incfs/format.c:416:21:    got int

fs/incfs/pseudo_files.c:925:25: warning: incorrect type in argument 4 (different base types)
fs/incfs/pseudo_files.c:925:25:    expected unsigned long long [usertype] size
fs/incfs/pseudo_files.c:925:25:    got restricted __le64 [addressable] [assigned] [usertype] size_attr_value
fs/incfs/pseudo_files.c:925:42: warning: incorrect type in argument 5 (different base types)
fs/incfs/pseudo_files.c:925:42:    expected unsigned long long [usertype] offset
fs/incfs/pseudo_files.c:925:42:    got restricted __le64 [usertype]
fs/incfs/pseudo_files.c:1111:24: warning: incorrect type in return expression (different base types)
fs/incfs/pseudo_files.c:1111:24:    expected restricted __poll_t
fs/incfs/pseudo_files.c:1111:24:    got int

Bug: 169258814
Fixes: Sparse errors introduced by 3f4938108a, 8334d69e65 and cb776f4576
Test: incfs_test passes, sparse shows no errors
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I48596e9521069fc77bf38c345a568529d61c77dc
This commit is contained in:
Paul Lawrence 2020-09-23 12:10:56 -07:00
parent 142953a07f
commit 23516028ff
2 changed files with 3 additions and 3 deletions

View File

@ -413,7 +413,7 @@ int incfs_write_mapping_fh_to_backing_file(struct backing_file_context *bfc,
fh.fh_mapped_file_size = cpu_to_le64(file_size);
fh.fh_original_uuid = *uuid;
fh.fh_flags = INCFS_FILE_MAPPED;
fh.fh_flags = cpu_to_le32(INCFS_FILE_MAPPED);
LOCK_REQUIRED(bfc->bc_mutex);

View File

@ -922,7 +922,7 @@ static long ioctl_create_mapped_file(struct mount_info *mi, void __user *arg)
}
error = init_new_mapped_file(mi, file_dentry, &args.source_file_id,
size_attr_value, cpu_to_le64(args.source_offset));
args.size, args.source_offset);
if (error)
goto delete_file;
@ -1108,7 +1108,7 @@ static __poll_t blocks_written_poll(struct file *f, poll_table *wait)
unsigned long blocks_written;
if (!mi)
return -EFAULT;
return 0;
poll_wait(f, &mi->mi_blocks_written_notif_wq, wait);
blocks_written = atomic_read(&mi->mi_blocks_written);