diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2018-05-23 10:43:28 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-05-23 14:40:24 +0300 |
commit | e62d871295d22653caa52a1cbe9161e1256a860c (patch) | |
tree | be322f9c43602aa74d9cc111228dc1b1204de982 | |
parent | aa82df887ab995473cd83c89777cdf4bc4685dd0 (diff) |
v4l2: Document expected fallthrough
Compilers may now enable warnings for implicit fallthrough of switch
case statements, to help catch errors. One such case is highlighted in
our v4l2 module:
v4l2.c: In function ‘v4l2_enum_frame_sizes’:
v4l2.c:179:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
frame->step_height = frmenum.stepwise.step_height;
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
v4l2.c:180:3: note: here
case V4L2_FRMSIZE_TYPE_CONTINUOUS:
^~~~
This fall through is expected, and the warning can be removed simply by
adding a comment to confirm that.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | v4l2.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -177,6 +177,7 @@ v4l2_enum_frame_sizes(struct v4l2_device *dev, struct v4l2_format_desc *format) case V4L2_FRMSIZE_TYPE_STEPWISE: frame->step_width = frmenum.stepwise.step_width; frame->step_height = frmenum.stepwise.step_height; + /* fallthrough */ case V4L2_FRMSIZE_TYPE_CONTINUOUS: frame->min_width = frmenum.stepwise.min_width; frame->min_height = frmenum.stepwise.min_height; |