diff options
author | Christoph Hellwig <hch@infradead.org> | 2007-11-08 12:27:47 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-11 19:22:46 -0500 |
commit | f3307f7276067e2f8f29a20e3ebe52887e8f9f00 (patch) | |
tree | 83ba74916e6dff503066c15e07495af8e2562eb4 | |
parent | 3fb8931645e23785ee406444a782ba03c31d0e71 (diff) |
[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 <hch@lst.de>
Acked-by: Mark Salyzyn <mark_salyzyn@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/scsi/aacraid/aachba.c | 11 | ||||
-rw-r--r-- | drivers/scsi/aacraid/commsup.c | 43 | ||||
-rw-r--r-- | drivers/scsi/aacraid/dpcsup.c | 8 | ||||
-rw-r--r-- | drivers/scsi/aacraid/linit.c | 10 | ||||
-rw-r--r-- | drivers/scsi/aacraid/rx.c | 2 |
5 files changed, 37 insertions, 37 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index ad8912cbe6e7..641c303d28ef 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 | |||
981 | aac_fib_init(fib); | 981 | aac_fib_init(fib); |
982 | readcmd = (struct aac_read *) fib_data(fib); | 982 | readcmd = (struct aac_read *) fib_data(fib); |
983 | readcmd->command = cpu_to_le32(VM_CtBlockRead); | 983 | readcmd->command = cpu_to_le32(VM_CtBlockRead); |
984 | readcmd->cid = cpu_to_le16(scmd_id(cmd)); | 984 | readcmd->cid = cpu_to_le32(scmd_id(cmd)); |
985 | readcmd->block = cpu_to_le32((u32)(lba&0xffffffff)); | 985 | readcmd->block = cpu_to_le32((u32)(lba&0xffffffff)); |
986 | readcmd->count = cpu_to_le32(count * 512); | 986 | readcmd->count = cpu_to_le32(count * 512); |
987 | 987 | ||
@@ -1072,7 +1072,7 @@ static int aac_write_block(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u3 | |||
1072 | aac_fib_init(fib); | 1072 | aac_fib_init(fib); |
1073 | writecmd = (struct aac_write *) fib_data(fib); | 1073 | writecmd = (struct aac_write *) fib_data(fib); |
1074 | writecmd->command = cpu_to_le32(VM_CtBlockWrite); | 1074 | writecmd->command = cpu_to_le32(VM_CtBlockWrite); |
1075 | writecmd->cid = cpu_to_le16(scmd_id(cmd)); | 1075 | writecmd->cid = cpu_to_le32(scmd_id(cmd)); |
1076 | writecmd->block = cpu_to_le32((u32)(lba&0xffffffff)); | 1076 | writecmd->block = cpu_to_le32((u32)(lba&0xffffffff)); |
1077 | writecmd->count = cpu_to_le32(count * 512); | 1077 | writecmd->count = cpu_to_le32(count * 512); |
1078 | writecmd->sg.count = cpu_to_le32(1); | 1078 | writecmd->sg.count = cpu_to_le32(1); |
@@ -1305,9 +1305,10 @@ int aac_get_adapter_info(struct aac_dev* dev) | |||
1305 | (int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid), | 1305 | (int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid), |
1306 | dev->supplement_adapter_info.VpdInfo.Tsid); | 1306 | dev->supplement_adapter_info.VpdInfo.Tsid); |
1307 | } | 1307 | } |
1308 | if (!aac_check_reset || ((aac_check_reset != 1) && | 1308 | if (!aac_check_reset || |
1309 | (dev->supplement_adapter_info.SupportedOptions2 & | 1309 | ((aac_check_reset != 1) && |
1310 | le32_to_cpu(AAC_OPTION_IGNORE_RESET)))) { | 1310 | (dev->supplement_adapter_info.SupportedOptions2 & |
1311 | cpu_to_le32(AAC_OPTION_IGNORE_RESET)))) { | ||
1311 | printk(KERN_INFO "%s%d: Reset Adapter Ignored\n", | 1312 | printk(KERN_INFO "%s%d: Reset Adapter Ignored\n", |
1312 | dev->name, dev->id); | 1313 | dev->name, dev->id); |
1313 | } | 1314 | } |
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index cb9a92f894ab..310fd80b8c06 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c | |||
@@ -796,13 +796,13 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) | |||
796 | */ | 796 | */ |
797 | switch (le32_to_cpu(aifcmd->command)) { | 797 | switch (le32_to_cpu(aifcmd->command)) { |
798 | case AifCmdDriverNotify: | 798 | case AifCmdDriverNotify: |
799 | switch (le32_to_cpu(((u32 *)aifcmd->data)[0])) { | 799 | switch (le32_to_cpu(((__le32 *)aifcmd->data)[0])) { |
800 | /* | 800 | /* |
801 | * Morph or Expand complete | 801 | * Morph or Expand complete |
802 | */ | 802 | */ |
803 | case AifDenMorphComplete: | 803 | case AifDenMorphComplete: |
804 | case AifDenVolumeExtendComplete: | 804 | case AifDenVolumeExtendComplete: |
805 | container = le32_to_cpu(((u32 *)aifcmd->data)[1]); | 805 | container = le32_to_cpu(((__le32 *)aifcmd->data)[1]); |
806 | if (container >= dev->maximum_num_containers) | 806 | if (container >= dev->maximum_num_containers) |
807 | break; | 807 | break; |
808 | 808 | ||
@@ -835,25 +835,25 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) | |||
835 | if (container >= dev->maximum_num_containers) | 835 | if (container >= dev->maximum_num_containers) |
836 | break; | 836 | break; |
837 | if ((dev->fsa_dev[container].config_waiting_on == | 837 | if ((dev->fsa_dev[container].config_waiting_on == |
838 | le32_to_cpu(*(u32 *)aifcmd->data)) && | 838 | le32_to_cpu(*(__le32 *)aifcmd->data)) && |
839 | time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT)) | 839 | time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT)) |
840 | dev->fsa_dev[container].config_waiting_on = 0; | 840 | dev->fsa_dev[container].config_waiting_on = 0; |
841 | } else for (container = 0; | 841 | } else for (container = 0; |
842 | container < dev->maximum_num_containers; ++container) { | 842 | container < dev->maximum_num_containers; ++container) { |
843 | if ((dev->fsa_dev[container].config_waiting_on == | 843 | if ((dev->fsa_dev[container].config_waiting_on == |
844 | le32_to_cpu(*(u32 *)aifcmd->data)) && | 844 | le32_to_cpu(*(__le32 *)aifcmd->data)) && |
845 | time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT)) | 845 | time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT)) |
846 | dev->fsa_dev[container].config_waiting_on = 0; | 846 | dev->fsa_dev[container].config_waiting_on = 0; |
847 | } | 847 | } |
848 | break; | 848 | break; |
849 | 849 | ||
850 | case AifCmdEventNotify: | 850 | case AifCmdEventNotify: |
851 | switch (le32_to_cpu(((u32 *)aifcmd->data)[0])) { | 851 | switch (le32_to_cpu(((__le32 *)aifcmd->data)[0])) { |
852 | /* | 852 | /* |
853 | * Add an Array. | 853 | * Add an Array. |
854 | */ | 854 | */ |
855 | case AifEnAddContainer: | 855 | case AifEnAddContainer: |
856 | container = le32_to_cpu(((u32 *)aifcmd->data)[1]); | 856 | container = le32_to_cpu(((__le32 *)aifcmd->data)[1]); |
857 | if (container >= dev->maximum_num_containers) | 857 | if (container >= dev->maximum_num_containers) |
858 | break; | 858 | break; |
859 | dev->fsa_dev[container].config_needed = ADD; | 859 | dev->fsa_dev[container].config_needed = ADD; |
@@ -866,7 +866,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) | |||
866 | * Delete an Array. | 866 | * Delete an Array. |
867 | */ | 867 | */ |
868 | case AifEnDeleteContainer: | 868 | case AifEnDeleteContainer: |
869 | container = le32_to_cpu(((u32 *)aifcmd->data)[1]); | 869 | container = le32_to_cpu(((__le32 *)aifcmd->data)[1]); |
870 | if (container >= dev->maximum_num_containers) | 870 | if (container >= dev->maximum_num_containers) |
871 | break; | 871 | break; |
872 | dev->fsa_dev[container].config_needed = DELETE; | 872 | dev->fsa_dev[container].config_needed = DELETE; |
@@ -880,7 +880,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) | |||
880 | * waiting on something else, setup to wait on a Config Change. | 880 | * waiting on something else, setup to wait on a Config Change. |
881 | */ | 881 | */ |
882 | case AifEnContainerChange: | 882 | case AifEnContainerChange: |
883 | container = le32_to_cpu(((u32 *)aifcmd->data)[1]); | 883 | container = le32_to_cpu(((__le32 *)aifcmd->data)[1]); |
884 | if (container >= dev->maximum_num_containers) | 884 | if (container >= dev->maximum_num_containers) |
885 | break; | 885 | break; |
886 | if (dev->fsa_dev[container].config_waiting_on && | 886 | if (dev->fsa_dev[container].config_waiting_on && |
@@ -905,13 +905,13 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) | |||
905 | if (container >= dev->maximum_num_containers) | 905 | if (container >= dev->maximum_num_containers) |
906 | break; | 906 | break; |
907 | if ((dev->fsa_dev[container].config_waiting_on == | 907 | if ((dev->fsa_dev[container].config_waiting_on == |
908 | le32_to_cpu(*(u32 *)aifcmd->data)) && | 908 | le32_to_cpu(*(__le32 *)aifcmd->data)) && |
909 | time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT)) | 909 | time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT)) |
910 | dev->fsa_dev[container].config_waiting_on = 0; | 910 | dev->fsa_dev[container].config_waiting_on = 0; |
911 | } else for (container = 0; | 911 | } else for (container = 0; |
912 | container < dev->maximum_num_containers; ++container) { | 912 | container < dev->maximum_num_containers; ++container) { |
913 | if ((dev->fsa_dev[container].config_waiting_on == | 913 | if ((dev->fsa_dev[container].config_waiting_on == |
914 | le32_to_cpu(*(u32 *)aifcmd->data)) && | 914 | le32_to_cpu(*(__le32 *)aifcmd->data)) && |
915 | time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT)) | 915 | time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT)) |
916 | dev->fsa_dev[container].config_waiting_on = 0; | 916 | dev->fsa_dev[container].config_waiting_on = 0; |
917 | } | 917 | } |
@@ -926,9 +926,9 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) | |||
926 | * wait for a container change. | 926 | * wait for a container change. |
927 | */ | 927 | */ |
928 | 928 | ||
929 | if ((((u32 *)aifcmd->data)[1] == cpu_to_le32(AifJobCtrZero)) | 929 | if (((__le32 *)aifcmd->data)[1] == cpu_to_le32(AifJobCtrZero) && |
930 | && ((((u32 *)aifcmd->data)[6] == ((u32 *)aifcmd->data)[5]) | 930 | (((__le32 *)aifcmd->data)[6] == ((__le32 *)aifcmd->data)[5] || |
931 | || (((u32 *)aifcmd->data)[4] == cpu_to_le32(AifJobStsSuccess)))) { | 931 | ((__le32 *)aifcmd->data)[4] == cpu_to_le32(AifJobStsSuccess))) { |
932 | for (container = 0; | 932 | for (container = 0; |
933 | container < dev->maximum_num_containers; | 933 | container < dev->maximum_num_containers; |
934 | ++container) { | 934 | ++container) { |
@@ -943,9 +943,9 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) | |||
943 | jiffies; | 943 | jiffies; |
944 | } | 944 | } |
945 | } | 945 | } |
946 | if ((((u32 *)aifcmd->data)[1] == cpu_to_le32(AifJobCtrZero)) | 946 | if (((__le32 *)aifcmd->data)[1] == cpu_to_le32(AifJobCtrZero) && |
947 | && (((u32 *)aifcmd->data)[6] == 0) | 947 | ((__le32 *)aifcmd->data)[6] == 0 && |
948 | && (((u32 *)aifcmd->data)[4] == cpu_to_le32(AifJobStsRunning))) { | 948 | ((__le32 *)aifcmd->data)[4] == cpu_to_le32(AifJobStsRunning)) { |
949 | for (container = 0; | 949 | for (container = 0; |
950 | container < dev->maximum_num_containers; | 950 | container < dev->maximum_num_containers; |
951 | ++container) { | 951 | ++container) { |
@@ -1373,9 +1373,10 @@ int aac_check_health(struct aac_dev * aac) | |||
1373 | 1373 | ||
1374 | printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED); | 1374 | printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED); |
1375 | 1375 | ||
1376 | if (!aac_check_reset || ((aac_check_reset != 1) && | 1376 | if (!aac_check_reset || |
1377 | (aac->supplement_adapter_info.SupportedOptions2 & | 1377 | ((aac_check_reset != 1) && |
1378 | le32_to_cpu(AAC_OPTION_IGNORE_RESET)))) | 1378 | (aac->supplement_adapter_info.SupportedOptions2 & |
1379 | cpu_to_le32(AAC_OPTION_IGNORE_RESET)))) | ||
1379 | goto out; | 1380 | goto out; |
1380 | host = aac->scsi_host_ptr; | 1381 | host = aac->scsi_host_ptr; |
1381 | if (aac->thread->pid != current->pid) | 1382 | if (aac->thread->pid != current->pid) |
@@ -1656,11 +1657,11 @@ int aac_command_thread(void *data) | |||
1656 | struct fib *fibptr; | 1657 | struct fib *fibptr; |
1657 | 1658 | ||
1658 | if ((fibptr = aac_fib_alloc(dev))) { | 1659 | if ((fibptr = aac_fib_alloc(dev))) { |
1659 | u32 * info; | 1660 | __le32 *info; |
1660 | 1661 | ||
1661 | aac_fib_init(fibptr); | 1662 | aac_fib_init(fibptr); |
1662 | 1663 | ||
1663 | info = (u32 *) fib_data(fibptr); | 1664 | info = (__le32 *) fib_data(fibptr); |
1664 | if (now.tv_usec > 500000) | 1665 | if (now.tv_usec > 500000) |
1665 | ++now.tv_sec; | 1666 | ++now.tv_sec; |
1666 | 1667 | ||
diff --git a/drivers/scsi/aacraid/dpcsup.c b/drivers/scsi/aacraid/dpcsup.c index e6032ffc66a6..4726ab666c52 100644 --- a/drivers/scsi/aacraid/dpcsup.c +++ b/drivers/scsi/aacraid/dpcsup.c | |||
@@ -229,11 +229,9 @@ unsigned int aac_command_normal(struct aac_queue *q) | |||
229 | * all QE there are and wake up all the waiters before exiting. | 229 | * all QE there are and wake up all the waiters before exiting. |
230 | */ | 230 | */ |
231 | 231 | ||
232 | unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index) | 232 | unsigned int aac_intr_normal(struct aac_dev *dev, u32 index) |
233 | { | 233 | { |
234 | u32 index = le32_to_cpu(Index); | 234 | dprintk((KERN_INFO "aac_intr_normal(%p,%x)\n", dev, index)); |
235 | |||
236 | dprintk((KERN_INFO "aac_intr_normal(%p,%x)\n", dev, Index)); | ||
237 | if ((index & 0x00000002L)) { | 235 | if ((index & 0x00000002L)) { |
238 | struct hw_fib * hw_fib; | 236 | struct hw_fib * hw_fib; |
239 | struct fib * fib; | 237 | struct fib * fib; |
@@ -301,7 +299,7 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index) | |||
301 | 299 | ||
302 | if (hwfib->header.Command == cpu_to_le16(NuFileSystem)) | 300 | if (hwfib->header.Command == cpu_to_le16(NuFileSystem)) |
303 | { | 301 | { |
304 | u32 *pstatus = (u32 *)hwfib->data; | 302 | __le32 *pstatus = (__le32 *)hwfib->data; |
305 | if (*pstatus & cpu_to_le32(0xffff0000)) | 303 | if (*pstatus & cpu_to_le32(0xffff0000)) |
306 | *pstatus = cpu_to_le32(ST_OK); | 304 | *pstatus = cpu_to_le32(ST_OK); |
307 | } | 305 | } |
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index b4c9ff1b0859..782fae83ab48 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c | |||
@@ -584,11 +584,11 @@ static int aac_eh_reset(struct scsi_cmnd* cmd) | |||
584 | * support a register, instead of a commanded, reset. | 584 | * support a register, instead of a commanded, reset. |
585 | */ | 585 | */ |
586 | if ((aac->supplement_adapter_info.SupportedOptions2 & | 586 | if ((aac->supplement_adapter_info.SupportedOptions2 & |
587 | le32_to_cpu(AAC_OPTION_MU_RESET)) && | 587 | cpu_to_le32(AAC_OPTION_MU_RESET)) && |
588 | aac_check_reset && | 588 | aac_check_reset && |
589 | ((aac_check_reset != 1) || | 589 | ((aac_check_reset != 1) || |
590 | (aac->supplement_adapter_info.SupportedOptions2 & | 590 | (aac->supplement_adapter_info.SupportedOptions2 & |
591 | le32_to_cpu(AAC_OPTION_IGNORE_RESET)))) | 591 | cpu_to_le32(AAC_OPTION_IGNORE_RESET)))) |
592 | aac_reset_adapter(aac, 2); /* Bypass wait for command quiesce */ | 592 | aac_reset_adapter(aac, 2); /* Bypass wait for command quiesce */ |
593 | return SUCCESS; /* Cause an immediate retry of the command with a ten second delay after successful tur */ | 593 | return SUCCESS; /* Cause an immediate retry of the command with a ten second delay after successful tur */ |
594 | } | 594 | } |
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c index 710a03e54ed0..9b831519a6fa 100644 --- a/drivers/scsi/aacraid/rx.c +++ b/drivers/scsi/aacraid/rx.c | |||
@@ -465,7 +465,7 @@ static int aac_rx_restart_adapter(struct aac_dev *dev, int bled) | |||
465 | u32 var; | 465 | u32 var; |
466 | 466 | ||
467 | if (!(dev->supplement_adapter_info.SupportedOptions2 & | 467 | if (!(dev->supplement_adapter_info.SupportedOptions2 & |
468 | le32_to_cpu(AAC_OPTION_MU_RESET)) || (bled >= 0) || (bled == -2)) { | 468 | cpu_to_le32(AAC_OPTION_MU_RESET)) || (bled >= 0) || (bled == -2)) { |
469 | if (bled) | 469 | if (bled) |
470 | printk(KERN_ERR "%s%d: adapter kernel panic'd %x.\n", | 470 | printk(KERN_ERR "%s%d: adapter kernel panic'd %x.\n", |
471 | dev->name, dev->id, bled); | 471 | dev->name, dev->id, bled); |