Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754239AbbGWW3I (ORCPT ); Thu, 23 Jul 2015 18:29:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43247 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753500AbbGWW3G (ORCPT ); Thu, 23 Jul 2015 18:29:06 -0400 From: Laura Abbott To: Mauro Carvalho Chehab , Hans Verkuil Cc: Laura Abbott , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND][PATCHv2] v4l2-ioctl: Give more information when device_caps are missing Date: Thu, 23 Jul 2015 15:28:48 -0700 Message-Id: <1437690528-32520-1-git-send-email-labbott@fedoraproject.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2294 Lines: 55 Currently, the warning for missing device_caps gives a backtrace like so: [] dump_stack+0x45/0x57 [] warn_slowpath_common+0x8a/0xc0 [] warn_slowpath_null+0x1a/0x20 [] v4l_querycap+0x43/0x80 [videodev] [] __video_do_ioctl+0x2a4/0x320 [videodev] [] ? do_last+0x195/0x1210 [] video_usercopy+0x22e/0x5b0 [videodev] [] ? v4l_querycap+0x80/0x80 [videodev] [] video_ioctl2+0x15/0x20 [videodev] [] v4l2_ioctl+0x113/0x150 [videodev] [] do_vfs_ioctl+0x2f8/0x4f0 [] ? __audit_syscall_entry+0xb4/0x110 [] ? do_audit_syscall_entry+0x6c/0x70 [] SyS_ioctl+0x81/0xa0 [] ? __audit_syscall_exit+0x1f6/0x2a0 [] system_call_fastpath+0x12/0x17 This indicates that device_caps are missing but doesn't give much of a clue which driver is actually at fault. Improve the warning output by showing the capabilities and the responsible driver. Signed-off-by: Laura Abbott --- I sent this out right before I went on vacation but I never saw any follow up. --- drivers/media/v4l2-core/v4l2-ioctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 85de455..ad7e929 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1025,8 +1025,9 @@ static int v4l_querycap(const struct v4l2_ioctl_ops *ops, * Drivers MUST fill in device_caps, so check for this and * warn if it was forgotten. */ - WARN_ON(!(cap->capabilities & V4L2_CAP_DEVICE_CAPS) || - !cap->device_caps); + WARN(!(cap->capabilities & V4L2_CAP_DEVICE_CAPS) || + !cap->device_caps, "Bad caps for driver %s, %x %x", + cap->driver, cap->capabilities, cap->device_caps); cap->device_caps |= V4L2_CAP_EXT_PIX_FORMAT; return ret; -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/