Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1590829 > unrolled thread

[PATCH] staging: lustre: fix sparse warning about different address spaces

Started byMario Bambagini <mario.bambagini@gmail.com>
First post2017-03-02 04:50 +0100
Last post2017-03-07 08:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: lustre: fix sparse warning about different address spaces Mario Bambagini <mario.bambagini@gmail.com> - 2017-03-02 04:50 +0100
    Re: [lustre-devel] [PATCH] staging: lustre: fix sparse warning about different address spaces Oleg Drokin <oleg.drokin@intel.com> - 2017-03-07 08:30 +0100

#1590829 — [PATCH] staging: lustre: fix sparse warning about different address spaces

FromMario Bambagini <mario.bambagini@gmail.com>
Date2017-03-02 04:50 +0100
Subject[PATCH] staging: lustre: fix sparse warning about different address spaces
Message-ID<tgpUC-4Kp-1@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1593935 — Re: [lustre-devel] [PATCH] staging: lustre: fix sparse warning about different address spaces

FromOleg Drokin <oleg.drokin@intel.com>
Date2017-03-07 08:30 +0100
SubjectRe: [lustre-devel] [PATCH] staging: lustre: fix sparse warning about different address spaces
Message-ID<tihJg-45F-9@gated-at.bofh.it>
In reply to#1590829
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web