tree:
https://git.linaro.org/people/lee.jones/linux.git android-3.18-preview
head: 3438af5abc0267b4033cf648679b9c31fe5875e2
commit: f9c7f7610723dc835728840963a5299ef5767552 [729/1070] media: fsl-viu: fix error
handling in viu_of_probe()
config: powerpc64-randconfig-r013-20210420 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 5.5.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add lee-linaro
https://git.linaro.org/people/lee.jones/linux.git
git fetch --no-tags lee-linaro android-3.18-preview
git checkout f9c7f7610723dc835728840963a5299ef5767552
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-5.5.0 make.cross W=1 ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/powerpc/kernel/time.c:40:0:
include/linux/mm.h: In function 'is_vmalloc_addr':
include/linux/mm.h:382:14: error: comparison between signed and unsigned integer
expressions [-Werror=sign-compare]
return addr >= VMALLOC_START && addr < VMALLOC_END;
^
In file included from arch/powerpc/include/asm/bug.h:127:0,
from include/linux/bug.h:4,
from include/linux/thread_info.h:11,
from include/asm-generic/preempt.h:4,
from arch/powerpc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from arch/powerpc/kernel/time.c:36:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/powerpc/include/asm/page.h:127:32: error: comparison of unsigned expression >=
0 is always true [-Werror=type-limits]
#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr)
^
include/asm-generic/bug.h:146:36: note: in definition of macro 'BUG_ON'
#define BUG_ON(condition) do { if (condition) BUG(); } while (0)
^
arch/powerpc/include/asm/page.h:132:32: note: in expansion of macro
'pfn_valid'
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
^
include/linux/scatterlist.h:115:10: note: in expansion of macro
'virt_addr_valid'
BUG_ON(!virt_addr_valid(buf));
^
In file included from include/linux/clockchips.h:27:0,
from arch/powerpc/kernel/time.c:45:
arch/powerpc/kernel/time.c: At top level:
include/linux/clocksource.h:112:75: error: signed and unsigned type in conditional
expression [-Werror=sign-compare]
#define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) :
-1)
^
arch/powerpc/kernel/time.c:84:18: note: in expansion of macro
'CLOCKSOURCE_MASK'
.mask = CLOCKSOURCE_MASK(64),
^
include/linux/clocksource.h:112:75: error: signed and unsigned type in conditional
expression [-Werror=sign-compare]
#define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) :
-1)
^
arch/powerpc/kernel/time.c:93:18: note: in expansion of macro
'CLOCKSOURCE_MASK'
.mask = CLOCKSOURCE_MASK(64),
^
arch/powerpc/kernel/time.c: In function '__delay':
arch/powerpc/kernel/time.c:398:17: error: comparison between signed and unsigned
integer expressions [-Werror=sign-compare]
} while (diff < loops);
^
arch/powerpc/kernel/time.c: At top level:
arch/powerpc/kernel/time.c:572:6: error: no previous prototype for
'hdec_interrupt' [-Werror=missing-prototypes]
void hdec_interrupt(struct pt_regs *regs)
^
> arch/powerpc/kernel/time.c:594:6: error: no previous prototype
for 'arch_suspend_disable_irqs' [-Werror=missing-prototypes]
void
arch_suspend_disable_irqs(void)
^
> arch/powerpc/kernel/time.c:602:6: error: no previous prototype
for 'arch_suspend_enable_irqs' [-Werror=missing-prototypes]
void
arch_suspend_enable_irqs(void)
^
arch/powerpc/kernel/time.c:890:13: error: no previous prototype for 'time_init'
[-Werror=missing-prototypes]
void __init time_init(void)
^
cc1: all warnings being treated as errors
--
> arch/powerpc/lib/xor_vmx.c:57:6: error: no previous prototype for
'xor_altivec_2' [-Werror=missing-prototypes]
void xor_altivec_2(unsigned
long bytes, unsigned long *v1_in,
^
> arch/powerpc/lib/xor_vmx.c:81:6: error: no previous prototype for
'xor_altivec_3' [-Werror=missing-prototypes]
void xor_altivec_3(unsigned
long bytes, unsigned long *v1_in,
^
> arch/powerpc/lib/xor_vmx.c:109:6: error: no previous prototype
for 'xor_altivec_4' [-Werror=missing-prototypes]
void
xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
^
> arch/powerpc/lib/xor_vmx.c:142:6: error: no previous prototype
for 'xor_altivec_5' [-Werror=missing-prototypes]
void
xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
^
cc1: all warnings being treated as errors
--
In file included from arch/powerpc/xmon/xmon.c:16:0:
include/linux/mm.h: In function 'is_vmalloc_addr':
include/linux/mm.h:382:14: error: comparison between signed and unsigned integer
expressions [-Werror=sign-compare]
return addr >= VMALLOC_START && addr < VMALLOC_END;
^
In file included from arch/powerpc/include/asm/bug.h:127:0,
from include/linux/bug.h:4,
from include/linux/thread_info.h:11,
from include/asm-generic/preempt.h:4,
from arch/powerpc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from arch/powerpc/xmon/xmon.c:14:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/powerpc/include/asm/page.h:127:32: error: comparison of unsigned expression >=
0 is always true [-Werror=type-limits]
#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr)
^
include/asm-generic/bug.h:146:36: note: in definition of macro 'BUG_ON'
#define BUG_ON(condition) do { if (condition) BUG(); } while (0)
^
arch/powerpc/include/asm/page.h:132:32: note: in expansion of macro
'pfn_valid'
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
^
include/linux/scatterlist.h:115:10: note: in expansion of macro
'virt_addr_valid'
BUG_ON(!virt_addr_valid(buf));
^
arch/powerpc/xmon/xmon.c: In function 'memex':
> arch/powerpc/xmon/xmon.c:1886:18: error: comparison between
signed and unsigned integer expressions [-Werror=sign-compare]
for (i = 0; i
< n; ++i)
^
arch/powerpc/xmon/xmon.c: In function 'scanhex':
arch/powerpc/xmon/xmon.c:2488:17: error: comparison between signed and unsigned integer
expressions [-Werror=sign-compare]
for (i = 0; i < sizeof(regname) - 1; ++i) {
^
arch/powerpc/xmon/xmon.c: In function 'read_spr':
> arch/powerpc/xmon/xmon.c:1572:16: error: variable 'ret'
might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
unsigned long ret = -1UL;
^
cc1: all warnings being treated as errors
--
arch/powerpc/xmon/nonstdio.c: In function 'xmon_printf':
> arch/powerpc/xmon/nonstdio.c:118:2: error: function might be
possible candidate for 'gnu_printf' format attribute
[-Werror=suggest-attribute=format]
n = vsnprintf(xmon_outbuf,
sizeof(xmon_outbuf), format, args);
^
cc1: all warnings being treated as errors
--
In file included from include/linux/scatterlist.h:6:0,
from include/linux/dma-mapping.h:9,
from include/media/videobuf-dma-contig.h:16,
from drivers/media/platform/fsl-viu.c:31:
include/linux/mm.h: In function 'is_vmalloc_addr':
include/linux/mm.h:382:14: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
return addr >= VMALLOC_START && addr < VMALLOC_END;
^
In file included from arch/powerpc/include/asm/bug.h:127:0,
from include/linux/bug.h:4,
from include/linux/thread_info.h:11,
from include/asm-generic/preempt.h:4,
from arch/powerpc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/linux/stat.h:18,
from include/linux/module.h:10,
from drivers/media/platform/fsl-viu.c:17:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/powerpc/include/asm/page.h:127:32: warning: comparison of unsigned expression
>= 0 is always true [-Wtype-limits]
#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr)
^
include/asm-generic/bug.h:146:36: note: in definition of macro 'BUG_ON'
#define BUG_ON(condition) do { if (condition) BUG(); } while (0)
^
arch/powerpc/include/asm/page.h:132:32: note: in expansion of macro
'pfn_valid'
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
^
include/linux/scatterlist.h:115:10: note: in expansion of macro
'virt_addr_valid'
BUG_ON(!virt_addr_valid(buf));
^
drivers/media/platform/fsl-viu.c: At top level:
drivers/media/platform/fsl-viu.c:272:17: warning: no previous prototype for
'format_by_fourcc' [-Wmissing-prototypes]
struct viu_fmt *format_by_fourcc(int fourcc)
^
drivers/media/platform/fsl-viu.c: In function 'format_by_fourcc':
drivers/media/platform/fsl-viu.c:276:16: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (i = 0; i < NUM_FORMATS; i++) {
^
drivers/media/platform/fsl-viu.c:277:30: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
if (formats[i].pixelformat == fourcc)
^
drivers/media/platform/fsl-viu.c: At top level:
drivers/media/platform/fsl-viu.c:285:6: warning: no previous prototype for
'viu_start_dma' [-Wmissing-prototypes]
void viu_start_dma(struct viu_dev *dev)
^
drivers/media/platform/fsl-viu.c:296:6: warning: no previous prototype for
'viu_stop_dma' [-Wmissing-prototypes]
void viu_stop_dma(struct viu_dev *dev)
^
drivers/media/platform/fsl-viu.c: In function 'buffer_prepare':
drivers/media/platform/fsl-viu.c:503:21: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
buf->vb.width != fh->width ||
^
drivers/media/platform/fsl-viu.c:504:21: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
buf->vb.height != fh->height ||
^
drivers/media/platform/fsl-viu.c: In function 'verify_preview':
drivers/media/platform/fsl-viu.c:730:26: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
field = (win->w.height > maxh/2)
^
drivers/media/platform/fsl-viu.c:746:19: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
if (win->w.width > maxw)
^
drivers/media/platform/fsl-viu.c:748:20: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
if (win->w.height > maxh)
^
drivers/media/platform/fsl-viu.c: At top level:
drivers/media/platform/fsl-viu.c:852:5: warning: no previous prototype for
'vidioc_g_fbuf' [-Wmissing-prototypes]
int vidioc_g_fbuf(struct file *file, void *priv, struct v4l2_framebuffer *arg)
^
drivers/media/platform/fsl-viu.c:863:5: warning: no previous prototype for
'vidioc_s_fbuf' [-Wmissing-prototypes]
int vidioc_s_fbuf(struct file *file, void *priv, const struct v4l2_framebuffer *arg)
^
drivers/media/platform/fsl-viu.c: In function 'vidioc_queryctrl':
drivers/media/platform/fsl-viu.c:1017:16: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(viu_qctrl); i++) {
^
drivers/media/platform/fsl-viu.c: In function 'vidioc_g_ctrl':
drivers/media/platform/fsl-viu.c:1031:16: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(viu_qctrl); i++) {
^
drivers/media/platform/fsl-viu.c: In function 'vidioc_s_ctrl':
drivers/media/platform/fsl-viu.c:1044:16: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(viu_qctrl); i++) {
^
drivers/media/platform/fsl-viu.c: In function 'viu_open':
drivers/media/platform/fsl-viu.c:1306:16: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(viu_qctrl); i++)
^
drivers/media/platform/fsl-viu.c: At top level:
drivers/media/platform/fsl-viu.c:1397:6: warning: no previous prototype for
'viu_reset' [-Wmissing-prototypes]
void viu_reset(struct viu_reg *reg)
^
drivers/media/platform/fsl-viu.c: In function 'viu_of_probe':
> drivers/media/platform/fsl-viu.c:1624:2: error: implicit
declaration of function 'v4l2_ctrl_handler_free'
[-Werror=implicit-function-declaration]
v4l2_ctrl_handler_free(&viu_dev->hdl);
^
> drivers/media/platform/fsl-viu.c:1624:33: error: 'struct
viu_dev' has no member named 'hdl'
v4l2_ctrl_handler_free(&viu_dev->hdl);
^
drivers/media/platform/fsl-viu.c:1625:1: warning: label 'err_i2c' defined but
not used [-Wunused-label]
err_i2c:
^
cc1: some warnings being treated as errors
vim +/v4l2_ctrl_handler_free +1624 drivers/media/platform/fsl-viu.c
1481
1482 static int viu_of_probe(struct platform_device *op)
1483 {
1484 struct viu_dev *viu_dev;
1485 struct video_device *vdev;
1486 struct resource r;
1487 struct viu_reg __iomem *viu_regs;
1488 struct i2c_adapter *ad;
1489 int ret, viu_irq;
1490 struct clk *clk;
1491
1492 ret = of_address_to_resource(op->dev.of_node, 0, &r);
1493 if (ret) {
1494 dev_err(&op->dev, "Can't parse device node resource\n");
1495 return -ENODEV;
1496 }
1497
1498 viu_irq = irq_of_parse_and_map(op->dev.of_node, 0);
1499 if (viu_irq == NO_IRQ) {
1500 dev_err(&op->dev, "Error while mapping the irq\n");
1501 return -EINVAL;
1502 }
1503
1504 /* request mem region */
1505 if (!devm_request_mem_region(&op->dev, r.start,
1506 sizeof(struct viu_reg), DRV_NAME)) {
1507 dev_err(&op->dev, "Error while requesting mem region\n");
1508 ret = -EBUSY;
1509 goto err_irq;
1510 }
1511
1512 /* remap registers */
1513 viu_regs = devm_ioremap(&op->dev, r.start, sizeof(struct viu_reg));
1514 if (!viu_regs) {
1515 dev_err(&op->dev, "Can't map register set\n");
1516 ret = -ENOMEM;
1517 goto err_irq;
1518 }
1519
1520 /* Prepare our private structure */
1521 viu_dev = devm_kzalloc(&op->dev, sizeof(struct viu_dev), GFP_ATOMIC);
1522 if (!viu_dev) {
1523 dev_err(&op->dev, "Can't allocate private structure\n");
1524 ret = -ENOMEM;
1525 goto err_irq;
1526 }
1527
1528 viu_dev->vr = viu_regs;
1529 viu_dev->irq = viu_irq;
1530 viu_dev->dev = &op->dev;
1531
1532 /* init video dma queues */
1533 INIT_LIST_HEAD(&viu_dev->vidq.active);
1534 INIT_LIST_HEAD(&viu_dev->vidq.queued);
1535
1536 snprintf(viu_dev->v4l2_dev.name,
1537 sizeof(viu_dev->v4l2_dev.name), "%s", "VIU");
1538 ret = v4l2_device_register(viu_dev->dev, &viu_dev->v4l2_dev);
1539 if (ret < 0) {
1540 dev_err(&op->dev, "v4l2_device_register() failed: %d\n", ret);
1541 goto err_irq;
1542 }
1543
1544 ad = i2c_get_adapter(0);
1545 if (!ad) {
1546 ret = -EFAULT;
1547 dev_err(&op->dev, "couldn't get i2c adapter\n");
1548 goto err_v4l2;
1549 }
1550
1551 viu_dev->decoder = v4l2_i2c_new_subdev(&viu_dev->v4l2_dev, ad,
1552 "saa7113", VIU_VIDEO_DECODER_ADDR, NULL);
1553
1554 viu_dev->vidq.timeout.function = viu_vid_timeout;
1555 viu_dev->vidq.timeout.data = (unsigned long)viu_dev;
1556 init_timer(&viu_dev->vidq.timeout);
1557 viu_dev->std = V4L2_STD_NTSC_M;
1558 viu_dev->first = 1;
1559
1560 /* Allocate memory for video device */
1561 vdev = video_device_alloc();
1562 if (vdev == NULL) {
1563 ret = -ENOMEM;
1564 goto err_hdl;
1565 }
1566
1567 memcpy(vdev, &viu_template, sizeof(viu_template));
1568
1569 vdev->v4l2_dev = &viu_dev->v4l2_dev;
1570
1571 viu_dev->vdev = vdev;
1572
1573 /* initialize locks */
1574 mutex_init(&viu_dev->lock);
1575 viu_dev->vdev->lock = &viu_dev->lock;
1576 spin_lock_init(&viu_dev->slock);
1577
1578 video_set_drvdata(viu_dev->vdev, viu_dev);
1579
1580 mutex_lock(&viu_dev->lock);
1581
1582 ret = video_register_device(viu_dev->vdev, VFL_TYPE_GRABBER, -1);
1583 if (ret < 0) {
1584 video_device_release(viu_dev->vdev);
1585 goto err_unlock;
1586 }
1587
1588 /* enable VIU clock */
1589 clk = devm_clk_get(&op->dev, "ipg");
1590 if (IS_ERR(clk)) {
1591 dev_err(&op->dev, "failed to lookup the clock!\n");
1592 ret = PTR_ERR(clk);
1593 goto err_vdev;
1594 }
1595 ret = clk_prepare_enable(clk);
1596 if (ret) {
1597 dev_err(&op->dev, "failed to enable the clock!\n");
1598 goto err_vdev;
1599 }
1600 viu_dev->clk = clk;
1601
1602 /* reset VIU module */
1603 viu_reset(viu_dev->vr);
1604
1605 /* install interrupt handler */
1606 if (request_irq(viu_dev->irq, viu_intr, 0, "viu", (void *)viu_dev))
{
1607 dev_err(&op->dev, "Request VIU IRQ failed.\n");
1608 ret = -ENODEV;
1609 goto err_clk;
1610 }
1611
1612 mutex_unlock(&viu_dev->lock);
1613
1614 dev_info(&op->dev, "Freescale VIU Video Capture Board\n");
1615 return ret;
1616
1617 err_clk:
1618 clk_disable_unprepare(viu_dev->clk);
1619 err_vdev:
1620 video_unregister_device(viu_dev->vdev);
1621 err_unlock:
1622 mutex_unlock(&viu_dev->lock);
1623 err_hdl:
1624 v4l2_ctrl_handler_free(&viu_dev->hdl);
1625 err_i2c:
1626 i2c_put_adapter(ad);
1627 err_v4l2:
1628 v4l2_device_unregister(&viu_dev->v4l2_dev);
1629 err_irq:
1630 irq_dispose_mapping(viu_irq);
1631 return ret;
1632 }
1633
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org