From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754727AbdCGHZp convert rfc822-to-8bit (ORCPT ); Tue, 7 Mar 2017 02:25:45 -0500 Received: from mga03.intel.com ([134.134.136.65]:19232 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754629AbdCGHZ2 (ORCPT ); Tue, 7 Mar 2017 02:25:28 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,257,1484035200"; d="scan'208";a="64988208" Subject: Re: [lustre-devel] [PATCH] staging: lustre: fix sparse warning about different address spaces Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Oleg Drokin In-Reply-To: <1488412629-20859-1-git-send-email-mario.bambagini@gmail.com> Date: Tue, 7 Mar 2017 00:38:16 -0500 Cc: , , , Content-Transfer-Encoding: 8BIT Message-Id: References: <1488412629-20859-1-git-send-email-mario.bambagini@gmail.com> To: Mario Bambagini X-Mailer: Apple Mail (2.1283) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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] * > drivers/staging//lustre/lustre/obdclass/obd_config.c:1055:74: got char *[assigned] sval > > Signed-off-by: Mario Bambagini 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