From: Mike Tipton Date: Fri, 22 Sep 2023 13:45:12 +0000 (-0700) Subject: debugfs: Fix __rcu type comparison warning X-Git-Tag: v6.6.7~1183 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=406d424454880087761dab65f7a7591a6e4cb717;p=platform%2Fkernel%2Flinux-starfive.git debugfs: Fix __rcu type comparison warning [ Upstream commit 7360a48bd0f5e62b2d00c387d5d3f2821eb290ce ] 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: 86b5488121db ("debugfs: Add write support to debugfs_create_str()") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309091933.BRWlSnCq-lkp@intel.com/ Signed-off-by: Mike Tipton Link: https://lore.kernel.org/r/20230922134512.5126-1-quic_mdtipton@quicinc.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 87b3753..c45e8c2 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -939,7 +939,7 @@ static ssize_t debugfs_write_file_str(struct file *file, const char __user *user new[pos + count] = '\0'; strim(new); - rcu_assign_pointer(*(char **)file->private_data, new); + rcu_assign_pointer(*(char __rcu **)file->private_data, new); synchronize_rcu(); kfree(old);