From e62d871295d22653caa52a1cbe9161e1256a860c Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Wed, 23 May 2018 10:43:28 +0100 Subject: v4l2: Document expected fallthrough MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Laurent Pinchart --- v4l2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/v4l2.c b/v4l2.c index a0036fd..f97a054 100644 --- a/v4l2.c +++ b/v4l2.c @@ -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; -- cgit v1.2.3