linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/ioctl: Remove unnecessary __user annotation
@ 2021-09-14 14:49 Amit Daniel Kachhap
  0 siblings, 0 replies; only message in thread
From: Amit Daniel Kachhap @ 2021-09-14 14:49 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: linux-kernel, Vincenzo Frascino, Amit Daniel Kachhap, Al Viro

__user annotations are used by the checker (e.g sparse) to mark user
pointers. However here __user is applied to a struct directly, without
a pointer being directly involved.

Although the presence of __user does not cause sparse to emit a warning,
__user should be removed for consistency with other uses of offsetof().

Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
---
 fs/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ioctl.c b/fs/ioctl.c
index 504e69578112..1ed097e94af2 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -430,7 +430,7 @@ static int ioctl_file_dedupe_range(struct file *file,
 		goto out;
 	}
 
-	size = offsetof(struct file_dedupe_range __user, info[count]);
+	size = offsetof(struct file_dedupe_range, info[count]);
 	if (size > PAGE_SIZE) {
 		ret = -ENOMEM;
 		goto out;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-14 14:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14 14:49 [PATCH] fs/ioctl: Remove unnecessary __user annotation Amit Daniel Kachhap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).