summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2009-06-20 12:57:24 -0500
committerMike Isely <isely@pobox.com>2009-06-20 12:57:24 -0500
commitb5fad74c736ea557049dd331ad48dc4bef7a81bd (patch)
tree80853e1209318913fbfe369cf23b5d390733c022 /linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c
parent1f30421cb0e68cbe8e33c96a120610732666c5a1 (diff)
downloadmediapointer-dvb-s2-b5fad74c736ea557049dd331ad48dc4bef7a81bd.tar.gz
mediapointer-dvb-s2-b5fad74c736ea557049dd331ad48dc4bef7a81bd.tar.bz2
pvrusb2: De-obfuscate code which handles routing schemes
From: Mike Isely <isely@pobox.com> 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...). Priority: normal Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c b/linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c
index 0c361e0ce..7bcaa0cd4 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c
@@ -68,12 +68,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)"
@@ -81,6 +80,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);
}
}