Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6dbc9c89 authored by Yoann Padioleau's avatar Yoann Padioleau Committed by David S. Miller
Browse files

[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: default avatarYoann Padioleau <padator@wanadoo.fr>
Cc: mcgrof@gmail.com
Cc: linux-wireless@vger.kernel.org
Cc: akpm@linux-foundation.org
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8951554d
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -435,7 +435,7 @@ static int arlan_sysctl_info(ctl_table * ctl, int write, struct file *filp,
		goto final;
	}
	else
		priva = arlan_device[devnum]->priv;
		priva = netdev_priv(arlan_device[devnum]);

	if (priva == NULL)
	{
@@ -654,7 +654,7 @@ static int arlan_sysctl_info161719(ctl_table * ctl, int write, struct file *filp
		goto final;
	}
	else
		priva = arlan_device[devnum]->priv;
		priva = netdev_priv(arlan_device[devnum]);
	if (priva == NULL)
	{
		printk(KERN_WARNING " Could not find the device private in arlan procsys, bad\n ");
@@ -688,7 +688,7 @@ static int arlan_sysctl_infotxRing(ctl_table * ctl, int write, struct file *filp
		  goto final;
	}
	else
		priva = arlan_device[devnum]->priv;
		priva = netdev_priv(arlan_device[devnum]);
	if (priva == NULL)
	{
		printk(KERN_WARNING " Could not find the device private in arlan procsys, bad\n ");
@@ -716,7 +716,7 @@ static int arlan_sysctl_inforxRing(ctl_table * ctl, int write, struct file *filp
		  pos += sprintf(arlan_drive_info + pos, "No device found here \n");
		  goto final;
	} else
		priva = arlan_device[devnum]->priv;
		priva = netdev_priv(arlan_device[devnum]);
	if (priva == NULL)
	{
		printk(KERN_WARNING " Could not find the device private in arlan procsys, bad\n ");
@@ -745,7 +745,7 @@ static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp,
		goto final;
	}
	else
		priva = arlan_device[devnum]->priv;
		priva = netdev_priv(arlan_device[devnum]);
	if (priva == NULL)
	{
		printk(KERN_WARNING " Could not find the device private in arlan procsys, bad\n ");
@@ -780,7 +780,7 @@ static int arlan_configure(ctl_table * ctl, int write, struct file *filp,
	}
	else if (arlan_device[devnum] != NULL)
	{
		  priv = arlan_device[devnum]->priv;
		  priv = netdev_priv(arlan_device[devnum]);

		  arlan_command(arlan_device[devnum], ARLAN_COMMAND_CLEAN_AND_CONF);
	}
@@ -805,7 +805,7 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp,
	}
	else if (arlan_device[devnum] != NULL)
	{
		priv = arlan_device[devnum]->priv;
		priv = netdev_priv(arlan_device[devnum]);
		arlan_command(arlan_device[devnum], ARLAN_COMMAND_CLEAN_AND_RESET);

	} else
+1 −1
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ static int sandisk_enable_wireless(struct net_device *dev)
{
	int res, ret = 0;
	conf_reg_t reg;
	struct hostap_interface *iface = dev->priv;
	struct hostap_interface *iface = netdev_priv(dev);
	local_info_t *local = iface->local;
	tuple_t tuple;
	cisparse_t *parse = NULL;
+1 −1
Original line number Diff line number Diff line
@@ -3424,7 +3424,7 @@ static void prism2_suspend(struct net_device *dev)
	struct local_info *local;
	union iwreq_data wrqu;

	iface = dev->priv;
	iface = netdev_priv(dev);
	local = iface->local;

	/* Send disconnect event, e.g., to trigger reassociation after resume
+7 −7
Original line number Diff line number Diff line
@@ -3088,7 +3088,7 @@ static int prism2_ioctl_priv_download(local_info_t *local, struct iw_point *p)
static int prism2_set_genericelement(struct net_device *dev, u8 *elem,
				     size_t len)
{
	struct hostap_interface *iface = dev->priv;
	struct hostap_interface *iface = netdev_priv(dev);
	local_info_t *local = iface->local;
	u8 *buf;

@@ -3116,7 +3116,7 @@ static int prism2_ioctl_siwauth(struct net_device *dev,
				struct iw_request_info *info,
				struct iw_param *data, char *extra)
{
	struct hostap_interface *iface = dev->priv;
	struct hostap_interface *iface = netdev_priv(dev);
	local_info_t *local = iface->local;

	switch (data->flags & IW_AUTH_INDEX) {
@@ -3182,7 +3182,7 @@ static int prism2_ioctl_giwauth(struct net_device *dev,
				struct iw_request_info *info,
				struct iw_param *data, char *extra)
{
	struct hostap_interface *iface = dev->priv;
	struct hostap_interface *iface = netdev_priv(dev);
	local_info_t *local = iface->local;

	switch (data->flags & IW_AUTH_INDEX) {
@@ -3221,7 +3221,7 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev,
				     struct iw_request_info *info,
				     struct iw_point *erq, char *extra)
{
	struct hostap_interface *iface = dev->priv;
	struct hostap_interface *iface = netdev_priv(dev);
	local_info_t *local = iface->local;
	struct iw_encode_ext *ext = (struct iw_encode_ext *) extra;
	int i, ret = 0;
@@ -3395,7 +3395,7 @@ static int prism2_ioctl_giwencodeext(struct net_device *dev,
				     struct iw_request_info *info,
				     struct iw_point *erq, char *extra)
{
	struct hostap_interface *iface = dev->priv;
	struct hostap_interface *iface = netdev_priv(dev);
	local_info_t *local = iface->local;
	struct ieee80211_crypt_data **crypt;
	void *sta_ptr;
@@ -3716,7 +3716,7 @@ static int prism2_ioctl_giwgenie(struct net_device *dev,
				 struct iw_request_info *info,
				 struct iw_point *data, char *extra)
{
	struct hostap_interface *iface = dev->priv;
	struct hostap_interface *iface = netdev_priv(dev);
	local_info_t *local = iface->local;
	int len = local->generic_elem_len - 2;

@@ -3755,7 +3755,7 @@ static int prism2_ioctl_siwmlme(struct net_device *dev,
				struct iw_request_info *info,
				struct iw_point *data, char *extra)
{
	struct hostap_interface *iface = dev->priv;
	struct hostap_interface *iface = netdev_priv(dev);
	local_info_t *local = iface->local;
	struct iw_mlme *mlme = (struct iw_mlme *) extra;
	u16 reason;
+1 −1
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev)
{
	struct net_device *dev = pci_get_drvdata(pdev);
	struct orinoco_private *priv = dev->priv;
	struct orinoco_private *priv = netdev_priv(dev);
	struct orinoco_pci_card *card = priv->card;

	unregister_netdev(dev);
Loading