Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759045AbbBHXk2 (ORCPT ); Sun, 8 Feb 2015 18:40:28 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:40512 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758957AbbBHXk1 (ORCPT ); Sun, 8 Feb 2015 18:40:27 -0500 Date: Mon, 9 Feb 2015 07:40:23 +0800 From: Greg Kroah-Hartman To: Adrian Remonda Cc: "open list:STAGING SUBSYSTEM" , "moderated list:STAGING - LUSTRE..." , Andreas Dilger , open list , Oleg Drokin , Anton Saraev Subject: Re: Question regarding sparse warning in staging/lustre Message-ID: <20150208234023.GA8572@kroah.com> References: <1423430844-28740-1-git-send-email-adrianremonda@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1423430844-28740-1-git-send-email-adrianremonda@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1569 Lines: 45 On Sun, Feb 08, 2015 at 10:27:23PM +0100, Adrian Remonda wrote: > Hello, > > I'm cleaning the drivers/staging/lustre driver. > I have got the next warning from sparse: > > drivers/staging/lustre/lnet/selftest//conctl.c:918:30: warning: incorrect type in argument 1 (different address spaces) > drivers/staging/lustre/lnet/selftest//conctl.c:918:30: expected void [noderef] *to > drivers/staging/lustre/lnet/selftest//conctl.c:918:30: got char *ioc_pbuf2 > > If I add the __user macro as next: > > --- a/drivers/staging/lustre/lnet/selftest/conctl.c > +++ b/drivers/staging/lustre/lnet/selftest/conctl.c > @@ -46,7 +46,7 @@ > #include "console.h" > > static int > -lst_session_new_ioctl(lstio_session_new_args_t *args) > +lst_session_new_ioctl(lstio_session_new_args_t __user *args) > { > char *name; > int rc; > > The warning turns to: > > drivers/staging/lustre/lnet/selftest//conctl.c:825:13: warning: dereference of noderef expression > > Now the question: > Is this right or it is just a false warning from sparse? > Should the __user macro should be also inside the structure fields? The user/kernel fields in lustre are a total mess, I wouldn't work on them if you don't have to as they need an overhaul in some areas. So I'd recommend just staying away :) good luck! greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/