Re: [RFC PATCH] usb: gadget: Introduce Cadence USB2 UDC Driver
From: kbuild test robot
Date: Fri Oct 16 2015 - 12:34:54 EST
Hi Neil,
[auto build test ERROR on balbi-usb/next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]
url: https://github.com/0day-ci/linux/commits/Neil-Armstrong/usb-gadget-Introduce-Cadence-USB2-UDC-Driver/20151016-225656
config: i386-allmodconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All error/warnings (new ones prefixed by >>):
>> drivers/usb/gadget/udc/cadence_hsudc.c:151:24: error: unknown type name 'dmashortirq'
unsigned dmairq, dmashortirq)
^
drivers/usb/gadget/udc/cadence_hsudc.c: In function 'cadence_hsudc_irq':
>> drivers/usb/gadget/udc/cadence_hsudc.c:224:5: error: implicit declaration of function 'cadence_hsudc_dma_irq' [-Werror=implicit-function-declaration]
cadence_hsudc_dma_irq(hsudc_dev, i,
^
drivers/usb/gadget/udc/cadence_hsudc.c: In function 'hsudc_copy_to_fifo':
>> drivers/usb/gadget/udc/cadence_hsudc.c:854:36: warning: dereferencing 'void *' pointer
hsudc_write32(*(uint32_t *)(&buf[i]), reg);
^
drivers/usb/gadget/udc/cadence_hsudc.c:143:11: note: in definition of macro 'hsudc_write32'
writel((value), hsudc_dev->io_base + (reg))
^
>> drivers/usb/gadget/udc/cadence_hsudc.c:854:32: warning: taking address of expression of type 'void'
hsudc_write32(*(uint32_t *)(&buf[i]), reg);
^
drivers/usb/gadget/udc/cadence_hsudc.c:143:11: note: in definition of macro 'hsudc_write32'
writel((value), hsudc_dev->io_base + (reg))
^
drivers/usb/gadget/udc/cadence_hsudc.c:858:36: warning: dereferencing 'void *' pointer
hsudc_write16(*(uint16_t *)(&buf[i]), reg);
^
drivers/usb/gadget/udc/cadence_hsudc.c:141:11: note: in definition of macro 'hsudc_write16'
writew((value)&0xFFFF, hsudc_dev->io_base + (reg))
^
drivers/usb/gadget/udc/cadence_hsudc.c:858:32: warning: taking address of expression of type 'void'
hsudc_write16(*(uint16_t *)(&buf[i]), reg);
^
drivers/usb/gadget/udc/cadence_hsudc.c:141:11: note: in definition of macro 'hsudc_write16'
writew((value)&0xFFFF, hsudc_dev->io_base + (reg))
^
drivers/usb/gadget/udc/cadence_hsudc.c:861:34: warning: dereferencing 'void *' pointer
hsudc_write8(*(uint8_t *)(&buf[i]), reg);
^
drivers/usb/gadget/udc/cadence_hsudc.c:139:11: note: in definition of macro 'hsudc_write8'
writeb((value)&0xFF, hsudc_dev->io_base + (reg))
^
drivers/usb/gadget/udc/cadence_hsudc.c:861:30: warning: taking address of expression of type 'void'
hsudc_write8(*(uint8_t *)(&buf[i]), reg);
^
drivers/usb/gadget/udc/cadence_hsudc.c:139:11: note: in definition of macro 'hsudc_write8'
writeb((value)&0xFF, hsudc_dev->io_base + (reg))
^
drivers/usb/gadget/udc/cadence_hsudc.c: In function 'hsudc_copy_from_fifo':
drivers/usb/gadget/udc/cadence_hsudc.c:877:23: warning: dereferencing 'void *' pointer
*((uint32_t *) &buf[i]) = hsudc_read32(reg);
^
drivers/usb/gadget/udc/cadence_hsudc.c:877:19: warning: taking address of expression of type 'void'
*((uint32_t *) &buf[i]) = hsudc_read32(reg);
^
drivers/usb/gadget/udc/cadence_hsudc.c:880:23: warning: dereferencing 'void *' pointer
*((uint16_t *) &buf[i]) = hsudc_read16(reg);
^
drivers/usb/gadget/udc/cadence_hsudc.c:880:19: warning: taking address of expression of type 'void'
*((uint16_t *) &buf[i]) = hsudc_read16(reg);
^
drivers/usb/gadget/udc/cadence_hsudc.c:883:7: warning: dereferencing 'void *' pointer
buf[i] = hsudc_read8(reg);
^
>> drivers/usb/gadget/udc/cadence_hsudc.c:883:4: error: invalid use of void expression
buf[i] = hsudc_read8(reg);
^
drivers/usb/gadget/udc/cadence_hsudc.c: In function 'hsudc_ep_completion':
>> drivers/usb/gadget/udc/cadence_hsudc.c:928:13: warning: unused variable 'i' [-Wunused-variable]
unsigned i;
^
cc1: some warnings being treated as errors
coccinelle warnings: (new ones prefixed by >>)
>> drivers/usb/gadget/udc/cadence_hsudc.c:1303:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)
--
>> drivers/usb/gadget/udc/cadence_hsudc.c:2127:6-11: No need to set .owner here. The core will do it.
Please review and possibly fold the followup patch.
vim +/dmashortirq +151 drivers/usb/gadget/udc/cadence_hsudc.c
145 #define hsudc_read8(reg) readb(hsudc_dev->io_base + (reg))
146 #define hsudc_read16(reg) readw(hsudc_dev->io_base + (reg))
147 #define hsudc_read32(reg) readl(hsudc_dev->io_base + (reg))
148
149 static inline void cadence_hsudc_dma_irq(struct cadence_hsudc *hsudc_dev,
150 unsigned dma_channel,
> 151 unsigned dmairq, dmashortirq)
152 {
153 struct hsudc_dma_channel *channel =
154 &hsudc_dev->dma_channels[dma_channel];
155
156 if ((dmairq & (1 << i))) {
157 /* Clear and disable DMAIRQ */
158 hsudc_write32(1 << i, HSUDC_DMA_IRQ_REG32);
159 hsudc_write32(hsudc_read32(HSUDC_DMA_IEN_REG32) &
160 ~(1 << dma_channel),
161 HSUDC_DMA_IEN_REG32);
162 }
163 if ((dmashortirq & (1 << dma_channel))) {
164 /* Clear and disable DMASHORTIRQ */
165 hsudc_write32(1 << dma_channel, HSUDC_DMA_SHORTIRQ_REG32);
166 hsudc_write32(hsudc_read32(HSUDC_DMA_SHORTIEN_REG32) &
167 ~(1 << dma_channel),
168 HSUDC_DMA_SHORTIEN_REG32);
169 }
170 if (channel->is_available &
171 channel->in_use &&
172 channel->cur_ep->cur) {
173 struct cadence_hsudc_request *hsudc_req =
174 channel->cur_ep->cur;
175 unsigned remain =
176 hsudc_read32(HSUDC_DMA_CNT_REG32(dma_channel));
177
178 hsudc_req->req.actual = hsudc_req->req.length - remain;
179
180 queue_work(hsudc_dev->wq_ep,
181 &channel->cur_ep->comp);
182
183 channel->cur_ep->dma_channel = NULL;
184 channel->cur_ep = NULL;
185 channel->in_use = 0;
186
187 /* Free DMA channel */
188 up(&hsudc_dev->dma_sem);
189 }
190 }
191
192 static irqreturn_t cadence_hsudc_irq(int irq, void *data)
193 {
194 struct cadence_hsudc *hsudc_dev = data;
195
196 unsigned in_packet_irq;
197 unsigned out_packet_irq;
198 unsigned usbirq;
199 unsigned dmairq, dmashortirq;
200
201 (void)irq;
202
203 in_packet_irq = hsudc_read16(HSUDC_INIRQ_REG16) &
204 hsudc_read16(HSUDC_INIEN_REG16);
205 out_packet_irq = hsudc_read16(HSUDC_OUTIRQ_REG16) &
206 hsudc_read16(HSUDC_OUTIEN_REG16);
207 usbirq = hsudc_read8(HSUDC_USBIRQ_REG8) &
208 hsudc_read8(HSUDC_USBIEN_REG8);
209
210 dmairq = hsudc_read32(HSUDC_DMA_IRQ_REG32) &
211 hsudc_read32(HSUDC_DMA_IEN_REG32);
212 dmashortirq = hsudc_read32(HSUDC_DMA_SHORTIRQ_REG32) &
213 hsudc_read32(HSUDC_DMA_SHORTIEN_REG32);
214
215 dev_vdbg(&hsudc_dev->pdev->dev, "irq: in %04X out %04X usb %04X dma %x/%x\n",
216 in_packet_irq, out_packet_irq,
217 usbirq, dmairq, dmashortirq);
218
219 if (dmairq || dmashortirq) {
220 unsigned i;
221
222 for (i = 0; i < hsudc_dev->hw_config->dma_channels; ++i)
223 if ((dmairq & (1 << i)) || (dmashortirq & (1 << i)))
> 224 cadence_hsudc_dma_irq(hsudc_dev, i,
225 dmairq, dmashortirq);
226 }
227
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: Binary data