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 /drivers/scsi/aacraid/commsup.c | |
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>
Diffstat (limited to 'drivers/scsi/aacraid/commsup.c')
-rw-r--r-- | drivers/scsi/aacraid/commsup.c | 43 |
1 files changed, 22 insertions, 21 deletions
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 | ||