提交 599bc36a 编写于 作者: A Andrey Utkin 提交者: 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: NDavid Binderman <dcb314@hotmail.com>
Signed-off-by: NAndrey Utkin <andrey.krieger.utkin@gmail.com>
Acked-by: NMike Isely <isely@pobox.com>
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
上级 a0f7fe5b
...@@ -949,17 +949,11 @@ static long pvr2_v4l2_ioctl(struct file *file, ...@@ -949,17 +949,11 @@ static long pvr2_v4l2_ioctl(struct file *file,
pvr2_hdw_commit_ctl(hdw); pvr2_hdw_commit_ctl(hdw);
if (ret < 0) { if (ret < 0) {
if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) {
pvr2_trace(PVR2_TRACE_V4LIOCTL,
"pvr2_v4l2_do_ioctl failure, ret=%ld", ret);
} else {
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" "pvr2_v4l2_do_ioctl failure, ret=%ld"
" command was:", ret); " command was:", ret);
v4l_printk_ioctl(pvr2_hdw_get_driver_name(hdw), v4l_printk_ioctl(pvr2_hdw_get_driver_name(hdw), cmd);
cmd);
}
} }
} else { } else {
pvr2_trace(PVR2_TRACE_V4LIOCTL, pvr2_trace(PVR2_TRACE_V4LIOCTL,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册