Re: [PATCH 2.6.12-rc4-mm1 4/4] megaraid_sas: updating the driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 17, 2005 at 10:59:13PM -0400, Bagalkote, Sreenivas wrote:
> >The void * casats are not okay.  Please make sure all your variable
> >holding the I/O address are of type void __iomem * and use 
> >sparse to check
> >it.  I would have sent you sparse output if your mailer didn't mangle
> >the patch so it couldn't be applied..
> >
> 
> I will remove these macros. What is sparse output?

sparse is a tool written by Linus that allows stricter type checking.
We use to verify that drivers don't directly dereference pointers to
userspace or I/O memory and that we always perform byte swapping on
hardware structures that have a defined endianess.

Unfortunately Linus doesn't seem to release tarballs of it, but Al Viro
has a semi-recent version at

    ftp://ftp.linux.org.uk/pub/people/viro/sparse.tar.bz2

To use it on a kernel tree build and install it and then compile your
driver with make C=1.  This doesn't check endianess yet, for that check
you need to edit the toplevel Makefile and add -Wbitwise to the
CHECKFLAGS line.

> >> +#define SCP2HOST(scp)		(scp)->device->host	
> >// to host
> >> +#define SCP2HOSTDATA(scp)	SCP2HOST(scp)->hostdata	// to soft state
> >> +#define SCP2CHANNEL(scp)	(scp)->device->channel	// to channel
> >> +#define SCP2TARGET(scp)		(scp)->device->id	
> >// to target
> >> +#define SCP2LUN(scp)		(scp)->device->lun	
> >// to LUN
> >
> >Please remove all these macros.
> 
> Christoph, I use these macros to have commonality between 2.4 and 2.6
> kernels. Please consider retaining them. 

While Linux 2.4 offers getting the host, id and lun from the scsi_cmnd
directly you can also get them from the scsi_device, so you can use
the above variants directly for both 2.4 and 2.6

-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux