Subject: Re: [PATCH 14/21] NTB: Fix Sparse Warnings

From: Jon Mason <[email-masked]>
Date: Mon, 21 Jan 2013 15:28:46 -0700

On Mon, Jan 21, 2013 at 01:37:19PM -0800, Greg KH wrote:
> On Mon, Jan 21, 2013 at 02:13:50PM -0700, Jon Mason wrote:
> > On Sun, Jan 20, 2013 at 03:45:34PM -0800, Greg KH wrote:
> > > On Sat, Jan 19, 2013 at 02:02:28AM -0700, Jon Mason wrote:
> > > > Address the sparse warnings and resulting fallout
> > > > 
> > > > Signed-off-by: Jon Mason <[email-masked]>
> > > > ---
> > > >  drivers/ntb/ntb_hw.c        |    7 ++++---
> > > >  drivers/ntb/ntb_hw.h        |    4 ++--
> > > >  drivers/ntb/ntb_transport.c |   32 ++++++++++++++++----------------
> > > >  3 files changed, 22 insertions(+), 21 deletions(-)
> > > > 
> > > > diff --git a/drivers/ntb/ntb_hw.c b/drivers/ntb/ntb_hw.c
> > > > index 18cb5dc..b792ccd 100644
> > > > --- a/drivers/ntb/ntb_hw.c
> > > > +++ b/drivers/ntb/ntb_hw.c
> > > > @@ -104,8 +104,9 @@ MODULE_DEVICE_TABLE(pci, ntb_pci_tbl);
> > > >   *
> > > >   * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
> > > >   */
> > > > -int ntb_register_event_callback(struct ntb_device *ndev,
> > > > -				void (*func)(void *handle, unsigned int event))
> > > > +int
> > > > +ntb_register_event_callback(struct ntb_device *ndev,
> > > > +			    void (*func)(void *handle, enum ntb_hw_event event))
> > > 
> > > What is sparse complaining about here that moving the function name to
> > > the start of the line fixes?  That shouldn't be necessary at all.  Ah,
> > > the enum?  If so, why change the first line at all?
> > 
> > All an effort to get it to fit in under 80 chars.
> 
> The original lines were less than 80 characters :)
> 
> > > > --- a/drivers/ntb/ntb_transport.c
> > > > +++ b/drivers/ntb/ntb_transport.c
> > > > @@ -58,7 +58,7 @@
> > > >  #include <linux/ntb.h>
> > > >  #include "ntb_hw.h"
> > > >  
> > > > -#define NTB_TRANSPORT_VERSION	1
> > > > +#define NTB_TRANSPORT_VERSION	2
> > > 
> > > How is this a sparse fix?
> > 
> > I changed the format of the header below.
> 
> Ah, ok.
> 
> Care to resend this without the first chunk?

Works for me :)

Resending with the minor edit now.

Thanks,
Jon

> thanks,
> greg k-h