diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-08-05 13:12:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 17:35:45 -0400 |
commit | b409214c683ed06c26e2cdad0be546ad11463354 (patch) | |
tree | e8274abb90ceb25877b689af00248c69a764db1a /drivers | |
parent | b3e670443b7fb8a2d29831b62b44a039c283e351 (diff) |
USB: remove fake "address-of" expressions
Fake "address-of" expressions that evaluate to NULL generally confuse
readers and can provoke compiler warnings. This patch (as1412)
removes three such fake expressions, using "#ifdef"s in their place.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/core/driver.c | 6 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/uhci-debug.c | 3 | ||||
-rw-r--r-- | drivers/usb/host/uhci-hcd.c | 23 |
4 files changed, 15 insertions, 23 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 880f65baf581..d7a4401ef019 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -1791,15 +1791,13 @@ static const struct dev_pm_ops usb_bus_pm_ops = { | |||
1791 | .runtime_idle = usb_runtime_idle, | 1791 | .runtime_idle = usb_runtime_idle, |
1792 | }; | 1792 | }; |
1793 | 1793 | ||
1794 | #else | ||
1795 | |||
1796 | #define usb_bus_pm_ops (*(const struct dev_pm_ops *) NULL) | ||
1797 | |||
1798 | #endif /* CONFIG_USB_SUSPEND */ | 1794 | #endif /* CONFIG_USB_SUSPEND */ |
1799 | 1795 | ||
1800 | struct bus_type usb_bus_type = { | 1796 | struct bus_type usb_bus_type = { |
1801 | .name = "usb", | 1797 | .name = "usb", |
1802 | .match = usb_device_match, | 1798 | .match = usb_device_match, |
1803 | .uevent = usb_uevent, | 1799 | .uevent = usb_uevent, |
1800 | #ifdef CONFIG_USB_SUSPEND | ||
1804 | .pm = &usb_bus_pm_ops, | 1801 | .pm = &usb_bus_pm_ops, |
1802 | #endif | ||
1805 | }; | 1803 | }; |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 5ae14f6c1e7a..fdd4130fbb7d 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -317,10 +317,6 @@ static const struct dev_pm_ops usb_device_pm_ops = { | |||
317 | .restore = usb_dev_restore, | 317 | .restore = usb_dev_restore, |
318 | }; | 318 | }; |
319 | 319 | ||
320 | #else | ||
321 | |||
322 | #define usb_device_pm_ops (*(struct dev_pm_ops *) NULL) | ||
323 | |||
324 | #endif /* CONFIG_PM */ | 320 | #endif /* CONFIG_PM */ |
325 | 321 | ||
326 | 322 | ||
@@ -338,7 +334,9 @@ struct device_type usb_device_type = { | |||
338 | .release = usb_release_dev, | 334 | .release = usb_release_dev, |
339 | .uevent = usb_dev_uevent, | 335 | .uevent = usb_dev_uevent, |
340 | .devnode = usb_devnode, | 336 | .devnode = usb_devnode, |
337 | #ifdef CONFIG_PM | ||
341 | .pm = &usb_device_pm_ops, | 338 | .pm = &usb_device_pm_ops, |
339 | #endif | ||
342 | }; | 340 | }; |
343 | 341 | ||
344 | 342 | ||
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index c168999722d1..6e7fb5f38db6 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | #include "uhci-hcd.h" | 18 | #include "uhci-hcd.h" |
19 | 19 | ||
20 | #define uhci_debug_operations (* (const struct file_operations *) NULL) | ||
21 | static struct dentry *uhci_debugfs_root; | 20 | static struct dentry *uhci_debugfs_root; |
22 | 21 | ||
23 | #ifdef DEBUG | 22 | #ifdef DEBUG |
@@ -558,7 +557,6 @@ static int uhci_debug_release(struct inode *inode, struct file *file) | |||
558 | return 0; | 557 | return 0; |
559 | } | 558 | } |
560 | 559 | ||
561 | #undef uhci_debug_operations | ||
562 | static const struct file_operations uhci_debug_operations = { | 560 | static const struct file_operations uhci_debug_operations = { |
563 | .owner = THIS_MODULE, | 561 | .owner = THIS_MODULE, |
564 | .open = uhci_debug_open, | 562 | .open = uhci_debug_open, |
@@ -566,6 +564,7 @@ static const struct file_operations uhci_debug_operations = { | |||
566 | .read = uhci_debug_read, | 564 | .read = uhci_debug_read, |
567 | .release = uhci_debug_release, | 565 | .release = uhci_debug_release, |
568 | }; | 566 | }; |
567 | #define UHCI_DEBUG_OPS | ||
569 | 568 | ||
570 | #endif /* CONFIG_DEBUG_FS */ | 569 | #endif /* CONFIG_DEBUG_FS */ |
571 | 570 | ||
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index b04506036b64..f52d04db28f4 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c | |||
@@ -597,7 +597,7 @@ static int uhci_start(struct usb_hcd *hcd) | |||
597 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); | 597 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); |
598 | int retval = -EBUSY; | 598 | int retval = -EBUSY; |
599 | int i; | 599 | int i; |
600 | struct dentry *dentry; | 600 | struct dentry __maybe_unused *dentry; |
601 | 601 | ||
602 | hcd->uses_new_polling = 1; | 602 | hcd->uses_new_polling = 1; |
603 | 603 | ||
@@ -607,18 +607,16 @@ static int uhci_start(struct usb_hcd *hcd) | |||
607 | INIT_LIST_HEAD(&uhci->idle_qh_list); | 607 | INIT_LIST_HEAD(&uhci->idle_qh_list); |
608 | init_waitqueue_head(&uhci->waitqh); | 608 | init_waitqueue_head(&uhci->waitqh); |
609 | 609 | ||
610 | if (DEBUG_CONFIGURED) { | 610 | #ifdef UHCI_DEBUG_OPS |
611 | dentry = debugfs_create_file(hcd->self.bus_name, | 611 | dentry = debugfs_create_file(hcd->self.bus_name, |
612 | S_IFREG|S_IRUGO|S_IWUSR, uhci_debugfs_root, | 612 | S_IFREG|S_IRUGO|S_IWUSR, uhci_debugfs_root, |
613 | uhci, &uhci_debug_operations); | 613 | uhci, &uhci_debug_operations); |
614 | if (!dentry) { | 614 | if (!dentry) { |
615 | dev_err(uhci_dev(uhci), "couldn't create uhci " | 615 | dev_err(uhci_dev(uhci), "couldn't create uhci debugfs entry\n"); |
616 | "debugfs entry\n"); | 616 | return -ENOMEM; |
617 | retval = -ENOMEM; | ||
618 | goto err_create_debug_entry; | ||
619 | } | ||
620 | uhci->dentry = dentry; | ||
621 | } | 617 | } |
618 | uhci->dentry = dentry; | ||
619 | #endif | ||
622 | 620 | ||
623 | uhci->frame = dma_alloc_coherent(uhci_dev(uhci), | 621 | uhci->frame = dma_alloc_coherent(uhci_dev(uhci), |
624 | UHCI_NUMFRAMES * sizeof(*uhci->frame), | 622 | UHCI_NUMFRAMES * sizeof(*uhci->frame), |
@@ -732,7 +730,6 @@ err_alloc_frame_cpu: | |||
732 | err_alloc_frame: | 730 | err_alloc_frame: |
733 | debugfs_remove(uhci->dentry); | 731 | debugfs_remove(uhci->dentry); |
734 | 732 | ||
735 | err_create_debug_entry: | ||
736 | return retval; | 733 | return retval; |
737 | } | 734 | } |
738 | 735 | ||