* [PATCH] staging: lustre: fix sparse warning about different address spaces
@ 2017-03-01 23:57 Mario Bambagini
2017-03-07 5:38 ` [lustre-devel] " Oleg Drokin
0 siblings, 1 reply; 2+ messages in thread
From: Mario Bambagini @ 2017-03-01 23:57 UTC (permalink / raw)
To: oleg.drokin
Cc: andreas.dilger, gregkh, lustre-devel, devel, linux-kernel,
Mario Bambagini
fixed the following sparse warning by adding proper cast:
drivers/staging//lustre/lustre/obdclass/obd_config.c:1055:74: warning: incorrect type in argument 2 (different address spaces)
drivers/staging//lustre/lustre/obdclass/obd_config.c:1055:74: expected char const [noderef] <asn:1>*<noident>
drivers/staging//lustre/lustre/obdclass/obd_config.c:1055:74: got char *[assigned] sval
Signed-off-by: Mario Bambagini <mario.bambagini@gmail.com>
---
drivers/staging/lustre/lustre/obdclass/obd_config.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c
index 9ca84c7..8fce88f 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_config.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c
@@ -1052,7 +1052,8 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
oldfs = get_fs();
set_fs(KERNEL_DS);
- rc = var->fops->write(&fakefile, sval,
+ rc = var->fops->write(&fakefile,
+ (const char __user *)sval,
vallen, NULL);
set_fs(oldfs);
}
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [lustre-devel] [PATCH] staging: lustre: fix sparse warning about different address spaces
2017-03-01 23:57 [PATCH] staging: lustre: fix sparse warning about different address spaces Mario Bambagini
@ 2017-03-07 5:38 ` Oleg Drokin
0 siblings, 0 replies; 2+ messages in thread
From: Oleg Drokin @ 2017-03-07 5:38 UTC (permalink / raw)
To: Mario Bambagini; +Cc: devel, gregkh, linux-kernel, lustre-devel
On Mar 1, 2017, at 6:57 PM, Mario Bambagini wrote:
> fixed the following sparse warning by adding proper cast:
> drivers/staging//lustre/lustre/obdclass/obd_config.c:1055:74: warning: incorrect type in argument 2 (different address spaces)
> drivers/staging//lustre/lustre/obdclass/obd_config.c:1055:74: expected char const [noderef] <asn:1>*<noident>
> drivers/staging//lustre/lustre/obdclass/obd_config.c:1055:74: got char *[assigned] sval
>
> Signed-off-by: Mario Bambagini <mario.bambagini@gmail.com>
The patch is fine, but just be advised this whole function is going away real soon now
per Al Viro request (and also because it no longer does what it should).
> ---
> drivers/staging/lustre/lustre/obdclass/obd_config.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c
> index 9ca84c7..8fce88f 100644
> --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c
> +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c
> @@ -1052,7 +1052,8 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
>
> oldfs = get_fs();
> set_fs(KERNEL_DS);
> - rc = var->fops->write(&fakefile, sval,
> + rc = var->fops->write(&fakefile,
> + (const char __user *)sval,
> vallen, NULL);
> set_fs(oldfs);
> }
> --
> 2.1.4
>
> _______________________________________________
> lustre-devel mailing list
> lustre-devel@lists.lustre.org
> http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-07 7:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-01 23:57 [PATCH] staging: lustre: fix sparse warning about different address spaces Mario Bambagini
2017-03-07 5:38 ` [lustre-devel] " Oleg Drokin
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).