All of lore.kernel.org
 help / color / mirror / Atom feed
* Question regarding sparse warning in staging/lustre
@ 2015-02-08 21:27 Adrian Remonda
  2015-02-08 23:40 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Remonda @ 2015-02-08 21:27 UTC (permalink / raw)
  Cc: Adrian Remonda, Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman,
	Luca Ceresoli, Anton Saraev, moderated list:STAGING - LUSTRE...,
	open list:STAGING SUBSYSTEM, open list

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] <asn:1>*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?

thanks in advance,

Adrian


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question regarding sparse warning in staging/lustre
  2015-02-08 21:27 Question regarding sparse warning in staging/lustre Adrian Remonda
@ 2015-02-08 23:40 ` Greg Kroah-Hartman
  2015-02-09 23:07   ` AdrianRemonda
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2015-02-08 23:40 UTC (permalink / raw)
  To: Adrian Remonda
  Cc: open list:STAGING SUBSYSTEM, moderated list:STAGING - LUSTRE...,
	Andreas Dilger, open list, Oleg Drokin, Anton Saraev

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] <asn:1>*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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question regarding sparse warning in staging/lustre
  2015-02-08 23:40 ` Greg Kroah-Hartman
@ 2015-02-09 23:07   ` AdrianRemonda
  2015-02-09 23:36     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: AdrianRemonda @ 2015-02-09 23:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: open list:STAGING SUBSYSTEM, moderated list:STAGING - LUSTRE...,
	Andreas Dilger, open list, Oleg Drokin, Anton Saraev

On Mon, Feb 09, 2015 at 07:40:23AM +0800, Greg Kroah-Hartman wrote:
> 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] <asn:1>*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

Ok. I had already done some modifications anyway. I sent you the patch
of the few I did

Regards,
Adrian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question regarding sparse warning in staging/lustre
  2015-02-09 23:07   ` AdrianRemonda
@ 2015-02-09 23:36     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2015-02-09 23:36 UTC (permalink / raw)
  To: AdrianRemonda
  Cc: open list:STAGING SUBSYSTEM, moderated list:STAGING - LUSTRE...,
	Andreas Dilger, open list, Oleg Drokin, Anton Saraev

On Tue, Feb 10, 2015 at 12:07:17AM +0100, AdrianRemonda wrote:
> On Mon, Feb 09, 2015 at 07:40:23AM +0800, Greg Kroah-Hartman wrote:
> > 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] <asn:1>*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
> 
> Ok. I had already done some modifications anyway. I sent you the patch
> of the few I did

I can't take those as I don't think they are correct, so I'll just drop
them, sorry.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-09 23:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-08 21:27 Question regarding sparse warning in staging/lustre Adrian Remonda
2015-02-08 23:40 ` Greg Kroah-Hartman
2015-02-09 23:07   ` AdrianRemonda
2015-02-09 23:36     ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.