diff options
author | Mike Isely <isely@pobox.com> | 2009-06-20 14:57:24 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-23 03:15:17 -0300 |
commit | 90135c96869fa0ef3182282b2a661b57fcdb7230 (patch) | |
tree | 807741895a1206e29eb0a4909790820caacd13e1 /drivers/media/video/pvrusb2/pvrusb2-cs53l32a.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-cs53l32a.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c b/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c index 41f6e009d5ef..68980e19409f 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c +++ b/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c @@ -67,12 +67,11 @@ void pvr2_cs53l32a_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) u32 input; pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", hdw->input_val); - if ((sid < ARRAY_SIZE(routing_schemes)) && - ((sp = routing_schemes[sid]) != NULL) && - (hdw->input_val >= 0) && - (hdw->input_val < sp->cnt)) { - input = sp->def[hdw->input_val]; - } else { + sp = (sid < ARRAY_SIZE(routing_schemes)) ? + routing_schemes[sid] : NULL; + if ((sp == NULL) || + (hdw->input_val < 0) || + (hdw->input_val >= sp->cnt)) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "*** WARNING *** subdev v4l2 set_input:" " Invalid routing scheme (%u)" @@ -80,6 +79,7 @@ void pvr2_cs53l32a_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) sid, hdw->input_val); return; } + input = sp->def[hdw->input_val]; sd->ops->audio->s_routing(sd, input, 0, 0); } } |