Commit dca762d6 authored by Larry Finger's avatar Larry Finger Committed by John W. Linville

[PATCH] bcm43xx: remove dead code in bcm43xx_sysfs.c

Coverity CID 1160 & 1161
Remove some dead code from bcm43xx_sysfs.c in 2.6.18-rc6
Signed-off-by: default avatarDarren Jenkins <darrenrjenkins@gmail.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 87d26327
...@@ -176,7 +176,6 @@ static ssize_t bcm43xx_attr_interfmode_show(struct device *dev, ...@@ -176,7 +176,6 @@ static ssize_t bcm43xx_attr_interfmode_show(struct device *dev,
char *buf) char *buf)
{ {
struct bcm43xx_private *bcm = dev_to_bcm(dev); struct bcm43xx_private *bcm = dev_to_bcm(dev);
int err;
ssize_t count = 0; ssize_t count = 0;
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
...@@ -197,11 +196,10 @@ static ssize_t bcm43xx_attr_interfmode_show(struct device *dev, ...@@ -197,11 +196,10 @@ static ssize_t bcm43xx_attr_interfmode_show(struct device *dev,
default: default:
assert(0); assert(0);
} }
err = 0;
mutex_unlock(&bcm->mutex); mutex_unlock(&bcm->mutex);
return err ? err : count; return count;
} }
...@@ -259,7 +257,6 @@ static ssize_t bcm43xx_attr_preamble_show(struct device *dev, ...@@ -259,7 +257,6 @@ static ssize_t bcm43xx_attr_preamble_show(struct device *dev,
char *buf) char *buf)
{ {
struct bcm43xx_private *bcm = dev_to_bcm(dev); struct bcm43xx_private *bcm = dev_to_bcm(dev);
int err;
ssize_t count; ssize_t count;
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
...@@ -272,10 +269,9 @@ static ssize_t bcm43xx_attr_preamble_show(struct device *dev, ...@@ -272,10 +269,9 @@ static ssize_t bcm43xx_attr_preamble_show(struct device *dev,
else else
count = snprintf(buf, PAGE_SIZE, "0 (Short Preamble disabled)\n"); count = snprintf(buf, PAGE_SIZE, "0 (Short Preamble disabled)\n");
err = 0;
mutex_unlock(&bcm->mutex); mutex_unlock(&bcm->mutex);
return err ? err : count; return count;
} }
static ssize_t bcm43xx_attr_preamble_store(struct device *dev, static ssize_t bcm43xx_attr_preamble_store(struct device *dev,
...@@ -284,7 +280,6 @@ static ssize_t bcm43xx_attr_preamble_store(struct device *dev, ...@@ -284,7 +280,6 @@ static ssize_t bcm43xx_attr_preamble_store(struct device *dev,
{ {
struct bcm43xx_private *bcm = dev_to_bcm(dev); struct bcm43xx_private *bcm = dev_to_bcm(dev);
unsigned long flags; unsigned long flags;
int err;
int value; int value;
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
...@@ -298,11 +293,10 @@ static ssize_t bcm43xx_attr_preamble_store(struct device *dev, ...@@ -298,11 +293,10 @@ static ssize_t bcm43xx_attr_preamble_store(struct device *dev,
bcm->short_preamble = !!value; bcm->short_preamble = !!value;
err = 0;
spin_unlock_irqrestore(&bcm->irq_lock, flags); spin_unlock_irqrestore(&bcm->irq_lock, flags);
mutex_unlock(&bcm->mutex); mutex_unlock(&bcm->mutex);
return err ? err : count; return count;
} }
static DEVICE_ATTR(shortpreamble, 0644, static DEVICE_ATTR(shortpreamble, 0644,
......
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