0cf30d9bb1b91d2a113ee6bc226d1cfb2e5c78d2
[oweals/openwrt.git] /
1 From bb6d0d223ef1579a13eae3cffc66db9ede83bbd1 Mon Sep 17 00:00:00 2001
2 From: Nathan Chancellor <natechancellor@gmail.com>
3 Date: Thu, 27 Sep 2018 17:50:39 -0700
4 Subject: [PATCH 257/703] staging: bcm2835-camera: Avoid unneeded internal
5  declaration warning
6
7 Clang warns:
8
9 drivers/staging/vc04_services/bcm2835-camera/controls.c:59:18: warning:
10 variable 'mains_freq_qmenu' is not needed and will not be emitted
11 [-Wunneeded-internal-declaration]
12 static const s64 mains_freq_qmenu[] = {
13                  ^
14 1 warning generated.
15
16 This is because mains_freq_qmenu is currently only used in an ARRAY_SIZE
17 macro, which is a compile time evaluation in this case. Avoid this by
18 adding mains_freq_qmenu as the imenu member of this structure, which
19 matches all other controls that uses the ARRAY_SIZE macro in v4l2_ctrls.
20 This turns out to be a no-op because V4L2_CID_MPEG_VIDEO_BITRATE_MODE is
21 defined as a MMAL_CONTROL_TYPE_STD_MENU, which does not pass the imenu
22 definition along to v4l2_ctrl_new in bm2835_mmal_init_controls.
23
24 Link: https://github.com/ClangBuiltLinux/linux/issues/122
25 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27 ---
28  drivers/staging/vc04_services/bcm2835-camera/controls.c | 2 +-
29  1 file changed, 1 insertion(+), 1 deletion(-)
30
31 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c
32 +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c
33 @@ -1109,7 +1109,7 @@ static const struct bm2835_mmal_v4l2_ctr
34         {
35                 V4L2_CID_POWER_LINE_FREQUENCY, MMAL_CONTROL_TYPE_STD_MENU,
36                 0, ARRAY_SIZE(mains_freq_qmenu) - 1,
37 -               1, 1, NULL,
38 +               1, 1, mains_freq_qmenu,
39                 MMAL_PARAMETER_FLICKER_AVOID,
40                 &ctrl_set_flicker_avoidance,
41                 false