From f3307f7276067e2f8f29a20e3ebe52887e8f9f00 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 8 Nov 2007 17:27:47 +0000 Subject: [SCSI] aacraid: don't assign cpu_to_le32(int) to u8 On Wed, Nov 07, 2007 at 01:51:44PM -0500, Salyzyn, Mark wrote: > Christoph Hellwig [mailto:hch@infradead.org] sez: > > Did anyone run the driver through sparse to see if we have > > more issues like this? > > There are some warnings from sparse, none like this one. I will deal > with the warnings ... Actually there are a lot of endianess warnings, fortunately most of them harmless. The patch below fixes all of them up (including the ones in the patch I replied to), except for aac_init_adapter which is really odd and I don't know what to do. [jejb fixed up rejections and checkpatch issues] Signed-off-by: Christoph Hellwig Acked-by: Mark Salyzyn Signed-off-by: James Bottomley --- drivers/scsi/aacraid/aachba.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/scsi/aacraid/aachba.c') diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index ad8912cbe6e..641c303d28e 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -981,7 +981,7 @@ static int aac_read_block(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u32 aac_fib_init(fib); readcmd = (struct aac_read *) fib_data(fib); readcmd->command = cpu_to_le32(VM_CtBlockRead); - readcmd->cid = cpu_to_le16(scmd_id(cmd)); + readcmd->cid = cpu_to_le32(scmd_id(cmd)); readcmd->block = cpu_to_le32((u32)(lba&0xffffffff)); readcmd->count = cpu_to_le32(count * 512); @@ -1072,7 +1072,7 @@ static int aac_write_block(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u3 aac_fib_init(fib); writecmd = (struct aac_write *) fib_data(fib); writecmd->command = cpu_to_le32(VM_CtBlockWrite); - writecmd->cid = cpu_to_le16(scmd_id(cmd)); + writecmd->cid = cpu_to_le32(scmd_id(cmd)); writecmd->block = cpu_to_le32((u32)(lba&0xffffffff)); writecmd->count = cpu_to_le32(count * 512); writecmd->sg.count = cpu_to_le32(1); @@ -1305,9 +1305,10 @@ int aac_get_adapter_info(struct aac_dev* dev) (int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid), dev->supplement_adapter_info.VpdInfo.Tsid); } - if (!aac_check_reset || ((aac_check_reset != 1) && - (dev->supplement_adapter_info.SupportedOptions2 & - le32_to_cpu(AAC_OPTION_IGNORE_RESET)))) { + if (!aac_check_reset || + ((aac_check_reset != 1) && + (dev->supplement_adapter_info.SupportedOptions2 & + cpu_to_le32(AAC_OPTION_IGNORE_RESET)))) { printk(KERN_INFO "%s%d: Reset Adapter Ignored\n", dev->name, dev->id); } -- cgit v1.2.3