Bug 455230
Summary: | v4l2 ioctl debug messages cannot be turned off | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Howard Gray <howard.gray> | ||||||
Component: | kernel | Assignee: | Mauro Carvalho Chehab <mchehab> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Martin Jenner <mjenner> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | low | ||||||||
Version: | 5.2 | CC: | adrian, arnd, dzickus, lwang, mchehab | ||||||
Target Milestone: | rc | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2009-01-20 20:25:00 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Howard Gray
2008-07-14 09:09:28 UTC
Created attachment 311686 [details]
Patch to correct "dbgarg" macro and allow V4L2 ioctl debug messages to be turned on or off with the debug flags
This is a backport from newer kernel versions, Without this patch the use of
V4L2 devices on RHEL 5.2 will be made considerably more difficult due to the
very high amount of debug messages created.
The patch only corrects the dbgarg macro, not dbgarg2, which has the same bug. No, I do not agree. The dbgarg2 macro consists only of an "if" followed by a single line: #define dbgarg2(fmt, arg...) \ if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \ printk (KERN_DEBUG "%s: " fmt, vfd->name, ## arg); So "{" ... "}" brackets are not strictly needed here unless for style purposes. Later kernel versions (e.g. 2.6.23) have only a corrected version of dbgarg not dbgarg2. Created attachment 311689 [details]
patch for this problem from the upstream kernel
Yes, you're right, the curly braces are not needed.
For correctness, it would be better to use the
do {
if (vfd->debug)
printk(...);
} while (0)
form though for both macros, fixing the code in the same way as upstream.
If it's not clear why, the 'do { } while (0)' form avoids problems with users
like
if (condition)
dbgarg(...)
else
bar();
that would otherwise turn into
if (condition)
if (vfd->debug)
printk(...);
else
bar();
which is something completely different.
For reference, the attached patch was merged into mainline to address this
problem.
Fine by me. Best to use the upstream patch, of course. sent to rhkernel-list in kernel-2.6.18-107.el5 You can download this test kernel from http://people.redhat.com/dzickus/el5 Will this fix appear in RHEL5.2? An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2009-0225.html |