On Tue, Nov 25, 2014 at 08:35:42AM +0100, Zahari Doychev wrote:
> On Tue, Nov 25, 2014 at 02:40:36AM +0300, Dan Carpenter wrote:
> > On Mon, Nov 24, 2014 at 07:55:41PM +0100, Zahari Doychev wrote:
> > > --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
> > > +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
> > > @@ -784,7 +784,8 @@ lnet_copy_iov2flat(int dlen, void *dest, unsigned int 
> > > doffset,
> > >              unsigned int nsiov, struct iovec *siov, unsigned int soffset,
> > >              unsigned int nob)
> > >  {
> > > - struct iovec diov = {/*.iov_base = */ dest, /*.iov_len = */ dlen};
> > > + struct iovec diov = {/*.iov_base = */ (void __user *)dest,
> > > +                      /*.iov_len = */ dlen};
> > >  
> > 
> > Why can't we just make the comments into code by removing the /*
> > characters?  Remove the cast by declaring the data as __user data to
> > begin with instead of declaring it incorrectly and then casting to the
> > correct type later.
> 
> If I make the declarations right then I am moving the casts to other 
> functions.

Yeah.  It might introduce new warnings.  Don't stress about that.  Don't
add casts, we'll just fix it all later.  It's better to have warnings
instead of hiding them with casts.

regards,
dan carpenter

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to