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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]