Commit 599bc36a authored by Andrey Utkin's avatar Andrey Utkin Committed by Mauro Carvalho Chehab

[media] media: pvrusb2: make logging code sane

The issue was discovered by static analysis. It turns out that code is
somewhat insane, being
if (x) {...} else { if (x) {...} }

Edited it to do the only reasonable thing, which is to log the
information about the failed call. The most descriptive logging commands
set is taken from original code.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=79801Reported-by: default avatarDavid Binderman <dcb314@hotmail.com>
Signed-off-by: default avatarAndrey Utkin <andrey.krieger.utkin@gmail.com>
Acked-by: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent a0f7fe5b
...@@ -951,15 +951,9 @@ static long pvr2_v4l2_ioctl(struct file *file, ...@@ -951,15 +951,9 @@ static long pvr2_v4l2_ioctl(struct file *file,
if (ret < 0) { if (ret < 0) {
if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) { if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) {
pvr2_trace(PVR2_TRACE_V4LIOCTL, pvr2_trace(PVR2_TRACE_V4LIOCTL,
"pvr2_v4l2_do_ioctl failure, ret=%ld", ret); "pvr2_v4l2_do_ioctl failure, ret=%ld"
} else { " command was:", ret);
if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) { v4l_printk_ioctl(pvr2_hdw_get_driver_name(hdw), cmd);
pvr2_trace(PVR2_TRACE_V4LIOCTL,
"pvr2_v4l2_do_ioctl failure, ret=%ld"
" command was:", ret);
v4l_printk_ioctl(pvr2_hdw_get_driver_name(hdw),
cmd);
}
} }
} else { } else {
pvr2_trace(PVR2_TRACE_V4LIOCTL, pvr2_trace(PVR2_TRACE_V4LIOCTL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment