@@ -17,8 +17,6 @@
#include "uhci-hcd.h"
-#define EXTRA_SPACE 1024
-
static struct dentry *uhci_debugfs_root;
#ifdef CONFIG_DYNAMIC_DEBUG
@@ -496,8 +494,7 @@ static int uhci_debug_open(struct inode *inode, struct file *file)
up->size = 0;
spin_lock_irqsave(&uhci->lock, flags);
if (uhci->is_initialized)
- up->size = uhci_sprint_schedule(uhci, up->data,
- MAX_OUTPUT - EXTRA_SPACE);
+ up->size = uhci_sprint_schedule(uhci, up->data, MAX_OUTPUT);
spin_unlock_irqrestore(&uhci->lock, flags);
file->private_data = up;
@@ -480,7 +480,7 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd)
if (debug > 1 && errbuf) {
/* Print the schedule for debugging */
uhci_sprint_schedule(uhci, errbuf,
- ERRBUF_LEN - EXTRA_SPACE);
+ ERRBUF_LEN);
lprintk(errbuf);
}
uhci_hc_died(uhci);
@@ -1199,7 +1199,7 @@ static int uhci_result_common(struct uhci_hcd *uhci, struct urb *urb)
if (debug > 1 && errbuf) {
/* Print the chain for debugging */
uhci_show_qh(uhci, urbp->qh, errbuf,
- ERRBUF_LEN - EXTRA_SPACE, 0);
+ ERRBUF_LEN, 0);
lprintk(errbuf);
}
}
The UHCI driver's debugging code used a lot of sprintf() calls with the large buffers, leaving 1024 bytes at the end of the buffers to handle buffer overflow. As that code was changed to call scnprintf() instead, there's no more buffer overflow, so we don't need #define EXTRA_SPACE anymore... Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> --- drivers/usb/host/uhci-debug.c | 5 +---- drivers/usb/host/uhci-hcd.c | 2 +- drivers/usb/host/uhci-q.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-)