Skip to content

Commit

Permalink
dev_dbg: check dev_dbg() arguments
Browse files Browse the repository at this point in the history
Duplicate what Zach Brown did for pr_debug in commit
8b2a1fd

[akpm@linux-foundation.org: fix a couple of things which broke]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dan Williams authored and Greg Kroah-Hartman committed Apr 27, 2007
1 parent 61a2f59 commit 404d5b1
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 1 addition & 3 deletions drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
@@ -119,8 +119,7 @@ MODULE_PARM_DESC(use_both_schemes,
"first one fails");


#ifdef DEBUG
static inline char *portspeed (int portstatus)
static inline char *portspeed(int portstatus)
{
if (portstatus & (1 << USB_PORT_FEAT_HIGHSPEED))
return "480 Mb/s";
@@ -129,7 +128,6 @@ static inline char *portspeed (int portstatus)
else
return "12 Mb/s";
}
#endif

/* Note that hdev or one of its children must be locked! */
static inline struct usb_hub *hdev_to_hub(struct usb_device *hdev)
6 changes: 0 additions & 6 deletions drivers/usb/host/ohci-hcd.c
Original file line number Diff line number Diff line change
@@ -486,9 +486,6 @@ static int ohci_run (struct ohci_hcd *ohci)
* or if bus glue did the same (e.g. for PCI add-in cards with
* PCI PM support).
*/
ohci_dbg (ohci, "resetting from state '%s', control = 0x%x\n",
hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS),
ohci_readl (ohci, &ohci->regs->control));
if ((ohci->hc_control & OHCI_CTRL_RWC) != 0
&& !device_may_wakeup(hcd->self.controller))
device_init_wakeup(hcd->self.controller, 1);
@@ -744,9 +741,6 @@ static void ohci_stop (struct usb_hcd *hcd)
{
struct ohci_hcd *ohci = hcd_to_ohci (hcd);

ohci_dbg (ohci, "stop %s controller (state 0x%02x)\n",
hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS),
hcd->state);
ohci_dump (ohci, 1);

flush_scheduled_work();
6 changes: 5 additions & 1 deletion include/linux/device.h
Original file line number Diff line number Diff line change
@@ -571,7 +571,11 @@ extern const char *dev_driver_string(struct device *dev);
#define dev_dbg(dev, format, arg...) \
dev_printk(KERN_DEBUG , dev , format , ## arg)
#else
#define dev_dbg(dev, format, arg...) do { (void)(dev); } while (0)
static inline int __attribute__ ((format (printf, 2, 3)))
dev_dbg(struct device * dev, const char * fmt, ...)
{
return 0;
}
#endif

#define dev_err(dev, format, arg...) \

0 comments on commit 404d5b1

Please sign in to comment.