diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-07-05 14:57:52 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-07-05 15:41:14 +0200 |
commit | c2b65f8422a3f51435c9f60f9752a6ed82d47e13 (patch) | |
tree | 80ca8d4d59dc45e8d1e352249718019e6ce94826 /drivers/usb/gadget/ci13xxx_udc.c | |
parent | usb: gadget: net2272: fix compile warnings (diff) | |
download | linux-c2b65f8422a3f51435c9f60f9752a6ed82d47e13.tar.xz linux-c2b65f8422a3f51435c9f60f9752a6ed82d47e13.zip |
usb: gadget: ci13xx_udc.c: fix compile warning
Fix the following compile warning:
| usb/gadget/ci13xxx_udc.c: In function 'show_registers':
| usb/gadget/ci13xxx_udc.c:1242:1: warning: the frame size of 2064 bytes is larger than 1024 bytes
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/ci13xxx_udc.c')
-rw-r--r-- | drivers/usb/gadget/ci13xxx_udc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c index 082471650fbc..1265a8502ea0 100644 --- a/drivers/usb/gadget/ci13xxx_udc.c +++ b/drivers/usb/gadget/ci13xxx_udc.c @@ -1214,12 +1214,13 @@ static DEVICE_ATTR(qheads, S_IRUSR, show_qheads, NULL); * * Check "device.h" for details */ +#define DUMP_ENTRIES 512 static ssize_t show_registers(struct device *dev, struct device_attribute *attr, char *buf) { struct ci13xxx *udc = container_of(dev, struct ci13xxx, gadget.dev); unsigned long flags; - u32 dump[512]; + u32 *dump; unsigned i, k, n = 0; dbg_trace("[%s] %p\n", __func__, buf); @@ -1228,8 +1229,14 @@ static ssize_t show_registers(struct device *dev, return 0; } + dump = kmalloc(sizeof(u32) * DUMP_ENTRIES, GFP_KERNEL); + if (!dump) { + dev_err(dev, "%s: out of memory\n", __func__); + return 0; + } + spin_lock_irqsave(udc->lock, flags); - k = hw_register_read(dump, sizeof(dump)/sizeof(u32)); + k = hw_register_read(dump, DUMP_ENTRIES); spin_unlock_irqrestore(udc->lock, flags); for (i = 0; i < k; i++) { @@ -1237,6 +1244,7 @@ static ssize_t show_registers(struct device *dev, "reg[0x%04X] = 0x%08X\n", i * (unsigned)sizeof(u32), dump[i]); } + kfree(dump); return n; } |