[PATCH] staging: lustre: fix sparse warning
by Tal Shorer
Sparse reports:
drivers/staging/lustre/lustre/obdclass/obd_mount.c:1284:6: warning:
symbol 'lustre_kill_super' was not declared. Should it be static?
Fix this warning by making lustre_kill_super static.
It is not used outside this file.
Signed-off-by: Tal Shorer <tal.shorer(a)gmail.com>
---
drivers/staging/lustre/lustre/obdclass/obd_mount.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
index 4f39cde..306aee1 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
@@ -1281,7 +1281,7 @@ struct dentry *lustre_mount(struct file_system_type *fs_type, int flags,
return mount_nodev(fs_type, flags, &lmd2, lustre_fill_super);
}
-void lustre_kill_super(struct super_block *sb)
+static void lustre_kill_super(struct super_block *sb)
{
struct lustre_sb_info *lsi = s2lsi(sb);
--
2.3.4
7 years, 1 month
[PATCH] staging: lustre: replace kzalloc with copy_from_user with memdup_user
by Dhere, Chaitanya (C.)
This patch replaces kzalloc and copy_from_user with memdup_user call
This change was detected with coccinelle tool
Signed-off-by: Chaitanya Dhere <cvijaydh(a)visteon.com>
---
drivers/staging/lustre/lustre/llite/file.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index 85e74d1..85b5567 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -2368,14 +2368,9 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
struct hsm_state_set *hss;
int rc;
- hss = kzalloc(sizeof(*hss), GFP_NOFS);
- if (!hss)
- return -ENOMEM;
-
- if (copy_from_user(hss, (char *)arg, sizeof(*hss))) {
- OBD_FREE_PTR(hss);
- return -EFAULT;
- }
+ hss = memdup_user((char *)arg, sizeof(*hss));
+ if (IS_ERR(hss))
+ return PTR_ERR(hss);
rc = ll_hsm_state_set(inode, hss);
--
1.7.9.5
7 years, 1 month
[PATCH] Corrected Staging Lustre rw26.c : include according to checkpatch.pl
by Georges-Axel Jaloyan
Signed-off-by: Georges-Axel Jaloyan <georges-axel.jaloyan(a)ens.fr>
---
drivers/staging/lustre/lustre/llite/rw26.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/llite/rw26.c b/drivers/staging/lustre/lustre/llite/rw26.c
index 2f21304..91442fa 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -44,7 +44,7 @@
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/unistd.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
#include <linux/migrate.h>
#include <linux/fs.h>
--
1.7.9.5
7 years, 1 month