diff options
author | Yoann Padioleau <padator@wanadoo.fr> | 2007-08-03 13:37:16 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:49:37 -0400 |
commit | 6dbc9c89fb242873bd3e83890e59da3d6e462025 (patch) | |
tree | 9e70567b27c3245b3bcd641cb63a29f8f648719a /drivers/net/wireless/hostap | |
parent | 8951554dba0c7962ae72faece66e8f5085a777d6 (diff) |
[PATCH] dev->priv to netdev_priv(dev), for drivers/net/wireless
Replacing accesses to dev->priv to netdev_priv(dev). The replacment
is safe when netdev_priv is used to access a private structure that is
right next to the net_device structure in memory. Cf
http://groups.google.com/group/comp.os.linux.development.system/browse_thread/thread/de19321bcd94dbb8/0d74a4adcd6177bd
This is the case when the net_device structure was allocated with
a call to alloc_netdev or one of its derivative.
Signed-off-by: Yoann Padioleau <padator@wanadoo.fr>
Cc: mcgrof@gmail.com
Cc: linux-wireless@vger.kernel.org
Cc: akpm@linux-foundation.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/hostap')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_cs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ioctl.c | 14 |
3 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index 30e723f6597..f9cf22bda42 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c | |||
@@ -272,7 +272,7 @@ static int sandisk_enable_wireless(struct net_device *dev) | |||
272 | { | 272 | { |
273 | int res, ret = 0; | 273 | int res, ret = 0; |
274 | conf_reg_t reg; | 274 | conf_reg_t reg; |
275 | struct hostap_interface *iface = dev->priv; | 275 | struct hostap_interface *iface = netdev_priv(dev); |
276 | local_info_t *local = iface->local; | 276 | local_info_t *local = iface->local; |
277 | tuple_t tuple; | 277 | tuple_t tuple; |
278 | cisparse_t *parse = NULL; | 278 | cisparse_t *parse = NULL; |
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index d3dacbceabb..adedb971654 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -3424,7 +3424,7 @@ static void prism2_suspend(struct net_device *dev) | |||
3424 | struct local_info *local; | 3424 | struct local_info *local; |
3425 | union iwreq_data wrqu; | 3425 | union iwreq_data wrqu; |
3426 | 3426 | ||
3427 | iface = dev->priv; | 3427 | iface = netdev_priv(dev); |
3428 | local = iface->local; | 3428 | local = iface->local; |
3429 | 3429 | ||
3430 | /* Send disconnect event, e.g., to trigger reassociation after resume | 3430 | /* Send disconnect event, e.g., to trigger reassociation after resume |
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index 8c71077d653..d58ac84f4e9 100644 --- a/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/hostap/hostap_ioctl.c | |||
@@ -3088,7 +3088,7 @@ static int prism2_ioctl_priv_download(local_info_t *local, struct iw_point *p) | |||
3088 | static int prism2_set_genericelement(struct net_device *dev, u8 *elem, | 3088 | static int prism2_set_genericelement(struct net_device *dev, u8 *elem, |
3089 | size_t len) | 3089 | size_t len) |
3090 | { | 3090 | { |
3091 | struct hostap_interface *iface = dev->priv; | 3091 | struct hostap_interface *iface = netdev_priv(dev); |
3092 | local_info_t *local = iface->local; | 3092 | local_info_t *local = iface->local; |
3093 | u8 *buf; | 3093 | u8 *buf; |
3094 | 3094 | ||
@@ -3116,7 +3116,7 @@ static int prism2_ioctl_siwauth(struct net_device *dev, | |||
3116 | struct iw_request_info *info, | 3116 | struct iw_request_info *info, |
3117 | struct iw_param *data, char *extra) | 3117 | struct iw_param *data, char *extra) |
3118 | { | 3118 | { |
3119 | struct hostap_interface *iface = dev->priv; | 3119 | struct hostap_interface *iface = netdev_priv(dev); |
3120 | local_info_t *local = iface->local; | 3120 | local_info_t *local = iface->local; |
3121 | 3121 | ||
3122 | switch (data->flags & IW_AUTH_INDEX) { | 3122 | switch (data->flags & IW_AUTH_INDEX) { |
@@ -3182,7 +3182,7 @@ static int prism2_ioctl_giwauth(struct net_device *dev, | |||
3182 | struct iw_request_info *info, | 3182 | struct iw_request_info *info, |
3183 | struct iw_param *data, char *extra) | 3183 | struct iw_param *data, char *extra) |
3184 | { | 3184 | { |
3185 | struct hostap_interface *iface = dev->priv; | 3185 | struct hostap_interface *iface = netdev_priv(dev); |
3186 | local_info_t *local = iface->local; | 3186 | local_info_t *local = iface->local; |
3187 | 3187 | ||
3188 | switch (data->flags & IW_AUTH_INDEX) { | 3188 | switch (data->flags & IW_AUTH_INDEX) { |
@@ -3221,7 +3221,7 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev, | |||
3221 | struct iw_request_info *info, | 3221 | struct iw_request_info *info, |
3222 | struct iw_point *erq, char *extra) | 3222 | struct iw_point *erq, char *extra) |
3223 | { | 3223 | { |
3224 | struct hostap_interface *iface = dev->priv; | 3224 | struct hostap_interface *iface = netdev_priv(dev); |
3225 | local_info_t *local = iface->local; | 3225 | local_info_t *local = iface->local; |
3226 | struct iw_encode_ext *ext = (struct iw_encode_ext *) extra; | 3226 | struct iw_encode_ext *ext = (struct iw_encode_ext *) extra; |
3227 | int i, ret = 0; | 3227 | int i, ret = 0; |
@@ -3395,7 +3395,7 @@ static int prism2_ioctl_giwencodeext(struct net_device *dev, | |||
3395 | struct iw_request_info *info, | 3395 | struct iw_request_info *info, |
3396 | struct iw_point *erq, char *extra) | 3396 | struct iw_point *erq, char *extra) |
3397 | { | 3397 | { |
3398 | struct hostap_interface *iface = dev->priv; | 3398 | struct hostap_interface *iface = netdev_priv(dev); |
3399 | local_info_t *local = iface->local; | 3399 | local_info_t *local = iface->local; |
3400 | struct ieee80211_crypt_data **crypt; | 3400 | struct ieee80211_crypt_data **crypt; |
3401 | void *sta_ptr; | 3401 | void *sta_ptr; |
@@ -3716,7 +3716,7 @@ static int prism2_ioctl_giwgenie(struct net_device *dev, | |||
3716 | struct iw_request_info *info, | 3716 | struct iw_request_info *info, |
3717 | struct iw_point *data, char *extra) | 3717 | struct iw_point *data, char *extra) |
3718 | { | 3718 | { |
3719 | struct hostap_interface *iface = dev->priv; | 3719 | struct hostap_interface *iface = netdev_priv(dev); |
3720 | local_info_t *local = iface->local; | 3720 | local_info_t *local = iface->local; |
3721 | int len = local->generic_elem_len - 2; | 3721 | int len = local->generic_elem_len - 2; |
3722 | 3722 | ||
@@ -3755,7 +3755,7 @@ static int prism2_ioctl_siwmlme(struct net_device *dev, | |||
3755 | struct iw_request_info *info, | 3755 | struct iw_request_info *info, |
3756 | struct iw_point *data, char *extra) | 3756 | struct iw_point *data, char *extra) |
3757 | { | 3757 | { |
3758 | struct hostap_interface *iface = dev->priv; | 3758 | struct hostap_interface *iface = netdev_priv(dev); |
3759 | local_info_t *local = iface->local; | 3759 | local_info_t *local = iface->local; |
3760 | struct iw_mlme *mlme = (struct iw_mlme *) extra; | 3760 | struct iw_mlme *mlme = (struct iw_mlme *) extra; |
3761 | u16 reason; | 3761 | u16 reason; |