aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2015-07-27 10:54:03 +0530
committerAmit Pundir <amit.pundir@linaro.org>2015-07-27 11:44:42 +0530
commitacfdf575920dde0377f9f59f1940d704661b2bc3 (patch)
tree88bd9d7ebab54f4e6b7bbba3bd0cef9a4917b204
parentf256ed70261066d04db7c9c1f7e9928359b3ced0 (diff)
Fix following unused variables/label warning when Uevent notification of gadget state to userspace, i.e. CONFIG_USB_CONFIGFS_UEVENT, is not enabled. -------------------- drivers/usb/gadget/configfs.c: In function 'gadgets_make': drivers/usb/gadget/configfs.c:1733:1: warning: label 'err' defined but not used [-Wunused-label] err: ^ drivers/usb/gadget/configfs.c:1654:6: warning: unused variable 'err' [-Wunused-variable] int err; ^ drivers/usb/gadget/configfs.c:1653:27: warning: unused variable 'attr' [-Wunused-variable] struct device_attribute *attr; ^ drivers/usb/gadget/configfs.c:1652:28: warning: unused variable 'attrs' [-Wunused-variable] struct device_attribute **attrs; ^ drivers/usb/gadget/configfs.c: In function 'gadgets_drop': drivers/usb/gadget/configfs.c:1741:27: warning: unused variable 'attr' [-Wunused-variable] struct device_attribute *attr; ^ drivers/usb/gadget/configfs.c:1740:28: warning: unused variable 'attrs' [-Wunused-variable] struct device_attribute **attrs; ^ -------------------- Change-Id: Idb87fdcad0b85805e497e2fa90ce63e0b1467656 Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r--drivers/usb/gadget/configfs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index bf2e4407786f..860c30eced91 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -1653,9 +1653,11 @@ static struct config_group *gadgets_make(
const char *name)
{
struct gadget_info *gi;
+#ifdef CONFIG_USB_CONFIGFS_UEVENT
struct device_attribute **attrs;
struct device_attribute *attr;
int err;
+#endif
gi = kzalloc(sizeof(*gi), GFP_KERNEL);
if (!gi)
@@ -1733,25 +1735,25 @@ err1:
device_destroy(android_device->class,
android_device->devt);
-#endif
err:
+#endif
kfree(gi);
return ERR_PTR(-ENOMEM);
}
static void gadgets_drop(struct config_group *group, struct config_item *item)
{
+#ifdef CONFIG_USB_CONFIGFS_UEVENT
struct device_attribute **attrs;
struct device_attribute *attr;
- config_item_put(item);
-
-#ifdef CONFIG_USB_CONFIGFS_UEVENT
attrs = android_usb_attributes;
while ((attr = *attrs++))
device_remove_file(android_device, attr);
device_destroy(android_device->class, android_device->devt);
#endif
+
+ config_item_put(item);
}
static struct configfs_group_operations gadgets_ops = {