diff options
author | Dan Williams <dcbw@redhat.com> | 2007-05-10 23:09:33 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-05-11 14:54:55 -0400 |
commit | c4aa7051b6d5697d2c0c169153e727c2e4175c5b (patch) | |
tree | 3370f1e62f36ed8305b00144a64fe1c2e3e927df | |
parent | 12a4d265e5ca354fb9225732b7e625bd00002bc4 (diff) |
[PATCH] libertas: sparse fixes
Fix various issues reported by sparse.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/ioctl.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/wireless/libertas/ioctl.c b/drivers/net/wireless/libertas/ioctl.c index 42dfd45890c2..a8f76c358992 100644 --- a/drivers/net/wireless/libertas/ioctl.c +++ b/drivers/net/wireless/libertas/ioctl.c | |||
@@ -680,6 +680,7 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req) | |||
680 | */ | 680 | */ |
681 | static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req) | 681 | static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req) |
682 | { | 682 | { |
683 | struct iwreq *wrq = (struct iwreq *)req; | ||
683 | static struct cmd_ds_fwt_access fwt_access; | 684 | static struct cmd_ds_fwt_access fwt_access; |
684 | int ret; | 685 | int ret; |
685 | 686 | ||
@@ -695,7 +696,7 @@ static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req) | |||
695 | (void *)&fwt_access); | 696 | (void *)&fwt_access); |
696 | 697 | ||
697 | if (ret == 0) | 698 | if (ret == 0) |
698 | req->ifr_data = (char *)(le32_to_cpu(fwt_access.references)); | 699 | wrq->u.param.value = le32_to_cpu(fwt_access.references); |
699 | else | 700 | else |
700 | return -EFAULT; | 701 | return -EFAULT; |
701 | 702 | ||
@@ -711,6 +712,7 @@ static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req) | |||
711 | */ | 712 | */ |
712 | static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req) | 713 | static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req) |
713 | { | 714 | { |
715 | struct iwreq *wrq = (struct iwreq *)req; | ||
714 | static struct cmd_ds_fwt_access fwt_access; | 716 | static struct cmd_ds_fwt_access fwt_access; |
715 | int ret; | 717 | int ret; |
716 | 718 | ||
@@ -726,7 +728,7 @@ static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req) | |||
726 | (void *)&fwt_access); | 728 | (void *)&fwt_access); |
727 | 729 | ||
728 | if (ret == 0) | 730 | if (ret == 0) |
729 | req->ifr_data = (char *)(le32_to_cpu(fwt_access.references)); | 731 | wrq->u.param.value = le32_to_cpu(fwt_access.references); |
730 | else | 732 | else |
731 | return -EFAULT; | 733 | return -EFAULT; |
732 | 734 | ||
@@ -742,6 +744,7 @@ static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req) | |||
742 | */ | 744 | */ |
743 | static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req) | 745 | static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req) |
744 | { | 746 | { |
747 | struct iwreq *wrq = (struct iwreq *)req; | ||
745 | struct cmd_ds_mesh_access mesh_access; | 748 | struct cmd_ds_mesh_access mesh_access; |
746 | int ret; | 749 | int ret; |
747 | 750 | ||
@@ -754,9 +757,8 @@ static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req) | |||
754 | cmd_option_waitforrsp, 0, | 757 | cmd_option_waitforrsp, 0, |
755 | (void *)&mesh_access); | 758 | (void *)&mesh_access); |
756 | 759 | ||
757 | if (ret == 0) { | 760 | if (ret == 0) |
758 | req->ifr_data = (char *)(le32_to_cpu(mesh_access.data[0])); | 761 | wrq->u.param.value = le32_to_cpu(mesh_access.data[0]); |
759 | } | ||
760 | else | 762 | else |
761 | return -EFAULT; | 763 | return -EFAULT; |
762 | 764 | ||
@@ -832,10 +834,9 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) | |||
832 | /* The first 4 bytes of req->ifr_data is sub-ioctl number | 834 | /* The first 4 bytes of req->ifr_data is sub-ioctl number |
833 | * after 4 bytes sits the payload. | 835 | * after 4 bytes sits the payload. |
834 | */ | 836 | */ |
835 | subcmd = wrq->u.data.flags; //from wpa_supplicant subcmd | 837 | subcmd = wrq->u.data.flags; |
836 | |||
837 | if (!subcmd) | 838 | if (!subcmd) |
838 | subcmd = (int)req->ifr_data; //from iwpriv subcmd | 839 | subcmd = (int)wrq->u.param.value; |
839 | 840 | ||
840 | switch (subcmd) { | 841 | switch (subcmd) { |
841 | case WLANSETREGION: | 842 | case WLANSETREGION: |
@@ -887,7 +888,7 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) | |||
887 | break; | 888 | break; |
888 | 889 | ||
889 | case WLAN_SETNONE_GETONEINT: | 890 | case WLAN_SETNONE_GETONEINT: |
890 | switch ((int)req->ifr_data) { | 891 | switch (wrq->u.param.value) { |
891 | case WLANGETREGION: | 892 | case WLANGETREGION: |
892 | pdata = (int *)wrq->u.name; | 893 | pdata = (int *)wrq->u.name; |
893 | *pdata = (int)adapter->regioncode; | 894 | *pdata = (int)adapter->regioncode; |