Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbeb20a1 authored by Paul Lawrence's avatar Paul Lawrence Committed by Sahil Sonar
Browse files

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 3f4938108a7ad, 8334d69e65f60 and cb776f45766a6
Test: incfs_test passes, sparse shows no errors
Signed-off-by: default avatarPaul Lawrence <paullawrence@google.com>
Change-Id: I509b113cec0c769df4824abcf5154b9936608038
parent cb84fbf7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);

+2 −2
Original line number Diff line number Diff line
@@ -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);