diff options
author | Mike Isely <isely@pobox.com> | 2009-06-20 13:57:24 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-23 02:15:17 -0400 |
commit | 90135c96869fa0ef3182282b2a661b57fcdb7230 (patch) | |
tree | 807741895a1206e29eb0a4909790820caacd13e1 /drivers/media/video/pvrusb2/pvrusb2-video-v4l.c | |
parent | 81e804c9c2e38431c1c01165d06076776c6fcbd6 (diff) |
V4L/DVB (12122): pvrusb2: De-obfuscate code which handles routing schemes
This change does not change any outward behavior; it merely chops down
some large if-conditions with embedded assignments into something a
little more maintainable for others (I of course never had a problem
with this...).
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-video-v4l.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-video-v4l.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c index 8c32288eebed..4c96cf48c796 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c +++ b/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c | |||
@@ -85,12 +85,12 @@ void pvr2_saa7115_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) | |||
85 | 85 | ||
86 | pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", | 86 | pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", |
87 | hdw->input_val); | 87 | hdw->input_val); |
88 | if ((sid < ARRAY_SIZE(routing_schemes)) && | 88 | |
89 | ((sp = routing_schemes[sid]) != NULL) && | 89 | sp = (sid < ARRAY_SIZE(routing_schemes)) ? |
90 | (hdw->input_val >= 0) && | 90 | routing_schemes[sid] : NULL; |
91 | (hdw->input_val < sp->cnt)) { | 91 | if ((sp == NULL) || |
92 | input = sp->def[hdw->input_val]; | 92 | (hdw->input_val < 0) || |
93 | } else { | 93 | (hdw->input_val >= sp->cnt)) { |
94 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, | 94 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
95 | "*** WARNING *** subdev v4l2 set_input:" | 95 | "*** WARNING *** subdev v4l2 set_input:" |
96 | " Invalid routing scheme (%u)" | 96 | " Invalid routing scheme (%u)" |
@@ -98,6 +98,7 @@ void pvr2_saa7115_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) | |||
98 | sid, hdw->input_val); | 98 | sid, hdw->input_val); |
99 | return; | 99 | return; |
100 | } | 100 | } |
101 | input = sp->def[hdw->input_val]; | ||
101 | sd->ops->video->s_routing(sd, input, 0, 0); | 102 | sd->ops->video->s_routing(sd, input, 0, 0); |
102 | } | 103 | } |
103 | } | 104 | } |