Skip to content

Commit 7360a48

Browse files
Mike Tiptongregkh
authored andcommitted
debugfs: Fix __rcu type comparison warning
Sparse reports the following: fs/debugfs/file.c:942:9: sparse: sparse: incompatible types in comparison expression (different address spaces): fs/debugfs/file.c:942:9: sparse: char [noderef] __rcu * fs/debugfs/file.c:942:9: sparse: char * rcu_assign_pointer() expects that it's assigning to pointers annotated with __rcu. We can't annotate the generic struct file::private_data, so cast it instead. Fixes: 86b5488 ("debugfs: Add write support to debugfs_create_str()") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Mike Tipton <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1dc05a2 commit 7360a48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/debugfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ static ssize_t debugfs_write_file_str(struct file *file, const char __user *user
939939
new[pos + count] = '\0';
940940
strim(new);
941941

942-
rcu_assign_pointer(*(char **)file->private_data, new);
942+
rcu_assign_pointer(*(char __rcu **)file->private_data, new);
943943
synchronize_rcu();
944944
kfree(old);
945945

0 commit comments

Comments
 (0)