Commit f30b8d23 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: more in drivers/net

drivers/net BROKEN_ON_SMP annotations and NULL noise removals.
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c75f5ad3
......@@ -731,7 +731,7 @@ static void sixpack_close(struct tty_struct *tty)
write_lock(&disc_data_lock);
sp = tty->disc_data;
tty->disc_data = 0;
tty->disc_data = NULL;
write_unlock(&disc_data_lock);
if (sp == 0)
return;
......@@ -750,7 +750,7 @@ static void sixpack_close(struct tty_struct *tty)
unregister_netdev(sp->dev);
}
static int sp_set_mac_address(struct net_device *dev, void *addr)
static int sp_set_mac_address(struct net_device *dev, void __user *addr)
{
return copy_from_user(dev->dev_addr, addr, AX25_ADDR_LEN) ? -EFAULT : 0;
}
......@@ -767,16 +767,16 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
switch(cmd) {
case SIOCGIFNAME:
err = copy_to_user((void *) arg, sp->dev->name,
err = copy_to_user((void __user *) arg, sp->dev->name,
strlen(sp->dev->name) + 1) ? -EFAULT : 0;
break;
case SIOCGIFENCAP:
err = put_user(0, (int *)arg);
err = put_user(0, (int __user *)arg);
break;
case SIOCSIFENCAP:
if (get_user(tmp, (int *) arg)) {
if (get_user(tmp, (int __user *) arg)) {
err = -EFAULT;
break;
}
......@@ -790,7 +790,7 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
break;
case SIOCSIFHWADDR:
err = sp_set_mac_address(sp->dev, (void *) arg);
err = sp_set_mac_address(sp->dev, (void __user *) arg);
break;
/* Allow stty to read, but not set, the serial port */
......
......@@ -626,7 +626,7 @@ static void ax25_close(struct tty_struct *tty)
unregister_netdev(ax->dev);
tty->disc_data = 0;
tty->disc_data = NULL;
ax->tty = NULL;
ax_free(ax);
......@@ -774,7 +774,7 @@ static void kiss_unesc(struct ax_disp *ax, unsigned char s)
}
static int ax_set_mac_address(struct net_device *dev, void *addr)
static int ax_set_mac_address(struct net_device *dev, void __user *addr)
{
if (copy_from_user(dev->dev_addr, addr, AX25_ADDR_LEN))
return -EFAULT;
......@@ -792,7 +792,7 @@ static int ax_set_dev_mac_address(struct net_device *dev, void *addr)
/* Perform I/O control on an active ax25 channel. */
static int ax25_disp_ioctl(struct tty_struct *tty, void *file, int cmd, void *arg)
static int ax25_disp_ioctl(struct tty_struct *tty, void *file, int cmd, void __user *arg)
{
struct ax_disp *ax = (struct ax_disp *) tty->disc_data;
unsigned int tmp;
......@@ -808,10 +808,10 @@ static int ax25_disp_ioctl(struct tty_struct *tty, void *file, int cmd, void *ar
return 0;
case SIOCGIFENCAP:
return put_user(4, (int *)arg);
return put_user(4, (int __user *)arg);
case SIOCSIFENCAP:
if (get_user(tmp, (int *)arg))
if (get_user(tmp, (int __user *)arg))
return -EFAULT;
ax->mode = tmp;
ax->dev->addr_len = AX25_ADDR_LEN; /* sizeof an AX.25 addr */
......
......@@ -756,7 +756,7 @@ xircom_up(struct net_device *dev)
xircom_init_ring(dev);
/* Clear the tx ring */
for (i = 0; i < TX_RING_SIZE; i++) {
tp->tx_skbuff[i] = 0;
tp->tx_skbuff[i] = NULL;
tp->tx_ring[i].status = 0;
}
......@@ -904,7 +904,7 @@ static void xircom_init_ring(struct net_device *dev)
/* The Tx buffer descriptor is filled in as needed, but we
do need to clear the ownership bit. */
for (i = 0; i < TX_RING_SIZE; i++) {
tp->tx_skbuff[i] = 0;
tp->tx_skbuff[i] = NULL;
tp->tx_ring[i].status = 0;
tp->tx_ring[i].buffer2 = virt_to_bus(&tp->tx_ring[i+1]);
#ifdef CARDBUS
......@@ -1128,7 +1128,7 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs
/* Free the original skb. */
dev_kfree_skb_irq(tp->tx_skbuff[entry]);
tp->tx_skbuff[entry] = 0;
tp->tx_skbuff[entry] = NULL;
}
#ifndef final_version
......@@ -1338,7 +1338,7 @@ xircom_close(struct net_device *dev)
/* Free all the skbuffs in the Rx queue. */
for (i = 0; i < RX_RING_SIZE; i++) {
struct sk_buff *skb = tp->rx_skbuff[i];
tp->rx_skbuff[i] = 0;
tp->rx_skbuff[i] = NULL;
tp->rx_ring[i].status = 0; /* Not owned by Xircom chip. */
tp->rx_ring[i].length = 0;
tp->rx_ring[i].buffer1 = 0xBADF00D0; /* An invalid address. */
......@@ -1349,7 +1349,7 @@ xircom_close(struct net_device *dev)
for (i = 0; i < TX_RING_SIZE; i++) {
if (tp->tx_skbuff[i])
dev_kfree_skb(tp->tx_skbuff[i]);
tp->tx_skbuff[i] = 0;
tp->tx_skbuff[i] = NULL;
}
tp->open = 0;
......@@ -1629,7 +1629,7 @@ static void set_rx_mode(struct net_device *dev)
if (entry != 0) {
/* Avoid a chip errata by prefixing a dummy entry. */
tp->tx_skbuff[entry] = 0;
tp->tx_skbuff[entry] = NULL;
tp->tx_ring[entry].length =
(entry == TX_RING_SIZE - 1) ? Tx1RingWrap : 0;
tp->tx_ring[entry].buffer1 = 0;
......@@ -1638,7 +1638,7 @@ static void set_rx_mode(struct net_device *dev)
entry = tp->cur_tx++ % TX_RING_SIZE;
}
tp->tx_skbuff[entry] = 0;
tp->tx_skbuff[entry] = NULL;
/* Put the setup frame on the Tx list. */
if (entry == TX_RING_SIZE - 1)
tx_flags |= Tx1RingWrap; /* Wrap ring. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment