summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-07-17 08:01:09 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-11-02 18:44:12 +0300
commitc9a06c0099d53aab5853a52076a756c967c121a5 (patch)
treedd6af8ed78c44714fdfa96e5633492b76cd9ed14
parentd9e0dded68a8de6a831dd9c31be32a45f4b67373 (diff)
downloadlinux-c9a06c0099d53aab5853a52076a756c967c121a5.tar.xz
netdrvr: natsemi: Fix device removal bug
This episode illustrates how an overused warning can train people to ignore that warning, which winds up hiding bugs. The warning drivers/net/natsemi.c: In function ‘natsemi_remove1’: drivers/net/natsemi.c:3222: warning: ignoring return value of ‘device_create_file’, declared with attribute warn_unused_result is oft-ignored, even though at close inspection one notices this occurs in the /remove/ function, not normally where creation occurs. A quick s/create/remove/ and we are fixed, with the warning gone. Signed-off-by: Jeff Garzik <jeff@garzik.org> Cc: Karsten Keil <kkeil@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/net/natsemi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 460a08718c69..41f68ec3a52e 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -671,7 +671,7 @@ static ssize_t natsemi_show_##_name(struct device *dev, \
#define NATSEMI_CREATE_FILE(_dev, _name) \
device_create_file(&_dev->dev, &dev_attr_##_name)
#define NATSEMI_REMOVE_FILE(_dev, _name) \
- device_create_file(&_dev->dev, &dev_attr_##_name)
+ device_remove_file(&_dev->dev, &dev_attr_##_name)
NATSEMI_ATTR(dspcfg_workaround);