Re: [PATCH v3] [media] v4l2: Add support for go2001 PCI codec driver
From: kbuild test robot
Date: Thu Jul 27 2017 - 02:33:43 EST
Hi Thierry,
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.13-rc2 next-20170726]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Thierry-Escande/v4l2-Add-support-for-go2001-PCI-codec-driver/20170727-033126
base: git://linuxtv.org/media_tree.git master
config: i386-allyesconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
drivers/media/pci/go2001/go2001_driver.c: In function 'go2001_buf_init':
>> drivers/media/pci/go2001/go2001_driver.c:274:32: warning: format '%zu' expects argument of type 'size_t', but argument 6 has type 'long unsigned int' [-Wformat=]
go2001_err(gdev, "Plane address/size not aligned %d/%zu\n",
^~~~~~~~
vim +274 drivers/media/pci/go2001/go2001_driver.c
240
241 static int go2001_buf_init(struct vb2_buffer *vb)
242 {
243 struct go2001_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue);
244 struct go2001_dev *gdev = ctx->gdev;
245 struct device *dev = &gdev->pdev->dev;
246 struct go2001_buffer *gbuf = vb_to_go2001_buf(vb);
247 struct go2001_dma_desc *dma_desc;
248 struct go2001_mmap_list_entry *mmap_list;
249 enum dma_data_direction dir;
250 struct scatterlist *sg;
251 struct sg_table *sgt;
252 u64 dma_addr;
253 u32 dma_len;
254 int plane, sgi;
255 int ret;
256
257 go2001_trace(gdev);
258
259 if (WARN_ON(gbuf->mapped))
260 return -EINVAL;
261
262 dir = V4L2_TYPE_IS_OUTPUT(vb->vb2_queue->type) ?
263 DMA_TO_DEVICE :
264 DMA_FROM_DEVICE;
265
266 for (plane = 0; plane < vb->num_planes; ++plane) {
267 dma_desc = &gbuf->dma_desc[plane];
268 WARN_ON(!IS_ALIGNED(dma_desc->map_addr, 16));
269
270 sgt = vb2_dma_sg_plane_desc(vb, plane);
271
272 if (!IS_ALIGNED(sgt->sgl->offset, 8) ||
273 !IS_ALIGNED(vb2_plane_size(vb, plane), 8)) {
> 274 go2001_err(gdev, "Plane address/size not aligned %d/%zu\n",
275 sgt->sgl->offset, vb2_plane_size(vb, plane));
276
277 ret = -EINVAL;
278 goto err;
279 }
280
281 dma_desc->num_entries = sgt->nents;
282 dma_desc->list_size = dma_desc->num_entries *
283 sizeof(struct go2001_mmap_list_entry);
284 dma_desc->mmap_list = dma_alloc_coherent(dev,
285 dma_desc->list_size,
286 &dma_desc->dma_addr,
287 GFP_KERNEL);
288 if (!dma_desc->mmap_list) {
289 go2001_err(gdev, "Failed allocating HW memory map\n");
290
291 ret = -ENOMEM;
292 goto err;
293 }
294
295 go2001_dbg(gdev, 3, "Plane %d: mmap list size: %zu\n", plane,
296 dma_desc->list_size);
297
298 mmap_list = dma_desc->mmap_list;
299 for_each_sg(sgt->sgl, sg, dma_desc->num_entries, sgi) {
300 dma_addr = sg_dma_address(sg);
301 dma_len = sg_dma_len(sg);
302
303 mmap_list[sgi].dma_addr = cpu_to_le64(dma_addr);
304 mmap_list[sgi].size = cpu_to_le32(dma_len);
305
306 go2001_dbg(gdev, 4, "Chunk %d: 0x%08llx, size %d\n",
307 sgi, dma_addr, dma_len);
308 }
309 }
310
311 ret = go2001_map_buffer(ctx, gbuf);
312 if (ret) {
313 go2001_err(ctx->gdev, "Failed mapping buffer in HW\n");
314 goto err;
315 }
316
317 return 0;
318
319 err:
320 for (; plane > 0; --plane) {
321 dma_desc = &gbuf->dma_desc[plane - 1];
322 dma_free_coherent(dev, dma_desc->list_size, dma_desc->mmap_list,
323 dma_desc->dma_addr);
324 memset(dma_desc, 0, sizeof(struct go2001_dma_desc));
325 }
326
327 return ret;
328 }
329
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip