mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: lustre: Correct two minor issues found by sparse
@ 2016-02-28 14:26 M. Vefa Bicakci
  2016-02-28 14:26 ` [PATCH 1/2] staging: lustre: Use const static file_operations struct M. Vefa Bicakci
  2016-02-28 14:26 ` [PATCH 2/2] staging: lustre: Use __user for a pointer to a user space address M. Vefa Bicakci
  0 siblings, 2 replies; 3+ messages in thread
From: M. Vefa Bicakci @ 2016-02-28 14:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman, M. Vefa Bicakci

The patches in this series correct two minor issues found by sparse in
staging/lustre.

These patches were tested with compilation only; given their nature, I
hope/believe this is sufficient. The patches apply cleanly onto commit
2cda64cf6998 ("staging: unisys: visorbus: Remove useless return variables")
which points to the tip of the staging-next and staging-testing branches
as of now.

M. Vefa Bicakci (2):
  staging: lustre: Use const static file_operations struct
  staging: lustre: Use __user for a pointer to a user space address

 drivers/staging/lustre/lustre/libcfs/module.c           | 2 +-
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] staging: lustre: Use const static file_operations struct
  2016-02-28 14:26 [PATCH 0/2] staging: lustre: Correct two minor issues found by sparse M. Vefa Bicakci
@ 2016-02-28 14:26 ` M. Vefa Bicakci
  2016-02-28 14:26 ` [PATCH 2/2] staging: lustre: Use __user for a pointer to a user space address M. Vefa Bicakci
  1 sibling, 0 replies; 3+ messages in thread
From: M. Vefa Bicakci @ 2016-02-28 14:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman, M. Vefa Bicakci

This commit corrects the following sparse warning regarding a
file_operations structure being non-static and constifies the
structure in question as well.

  warning: symbol 'lprocfs_stats_seq_fops' was not declared.
    Should it be static?

Signed-off-by: M. Vefa Bicakci <m.v.b@runbox.com>
---
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 28bb4e53adaa..1c39e90979df 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1196,7 +1196,7 @@ static int lprocfs_stats_seq_open(struct inode *inode, struct file *file)
 	return 0;
 }
 
-struct file_operations lprocfs_stats_seq_fops = {
+static const struct file_operations lprocfs_stats_seq_fops = {
 	.owner   = THIS_MODULE,
 	.open    = lprocfs_stats_seq_open,
 	.read    = seq_read,
-- 
2.5.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] staging: lustre: Use __user for a pointer to a user space address
  2016-02-28 14:26 [PATCH 0/2] staging: lustre: Correct two minor issues found by sparse M. Vefa Bicakci
  2016-02-28 14:26 ` [PATCH 1/2] staging: lustre: Use const static file_operations struct M. Vefa Bicakci
@ 2016-02-28 14:26 ` M. Vefa Bicakci
  1 sibling, 0 replies; 3+ messages in thread
From: M. Vefa Bicakci @ 2016-02-28 14:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman, M. Vefa Bicakci

This commit corrects two sparse warnings caused by the lack of a __user
annotation for the third argument of the libcfs_ioctl_handle function.

  module.c:165:68: warning: incorrect type in argument 1
    (different address spaces)
  module.c:165:68:    expected void [noderef] <asn:1>*arg
  module.c:165:68:    got void *arg
  module.c:209:47: warning: incorrect type in argument 3
    (different address spaces)
  module.c:209:47:    expected void *arg
  module.c:209:47:    got void [noderef] <asn:1>*arg

The need to have the __user annotation is supported by the fact that
libcfs_ioctl_handle passes its third argument to a helper function
(libcfs_ioctl_popdata) which also has a __user annotation for its
corresponding argument.

Signed-off-by: M. Vefa Bicakci <m.v.b@runbox.com>
---
 drivers/staging/lustre/lustre/libcfs/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
index 05e2c5625220..f3845dcee259 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -120,7 +120,7 @@ int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand)
 EXPORT_SYMBOL(libcfs_deregister_ioctl);
 
 static int libcfs_ioctl_handle(struct cfs_psdev_file *pfile, unsigned long cmd,
-			       void *arg, struct libcfs_ioctl_hdr *hdr)
+			       void __user *arg, struct libcfs_ioctl_hdr *hdr)
 {
 	struct libcfs_ioctl_data *data = NULL;
 	int err = -EINVAL;
-- 
2.5.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-28 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-28 14:26 [PATCH 0/2] staging: lustre: Correct two minor issues found by sparse M. Vefa Bicakci
2016-02-28 14:26 ` [PATCH 1/2] staging: lustre: Use const static file_operations struct M. Vefa Bicakci
2016-02-28 14:26 ` [PATCH 2/2] staging: lustre: Use __user for a pointer to a user space address M. Vefa Bicakci

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®