fe1f726db4d4df03fc777061f46df07ee69ffd28
[openwrt/staging/blocktrron.git] /
1 From 435790899f2abfabf1efb77861a57c0184026b37 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Mon, 8 Oct 2018 18:26:15 +0100
4 Subject: [PATCH 262/782] staging: bcm2835-camera: Correct
5 V4L2_CID_COLORFX_CBCR behaviour
6
7 With V4L2_CID_COLORFX_CBCR calling ctrl_set_colfx it was incorrectly
8 assigning the colour values to the enable field of dev->colourfx
9 instead of the u and v fields.
10
11 Correct the assignments.
12
13 Reported as a Coverity issue
14 Detected by CoverityScan CID#1419711 ("Unused value")
15
16 Reported-by: Colin Ian King <colin.king@canonical.com>
17 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
18 ---
19 drivers/staging/vc04_services/bcm2835-camera/controls.c | 4 ++--
20 1 file changed, 2 insertions(+), 2 deletions(-)
21
22 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c
23 +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c
24 @@ -578,8 +578,8 @@ static int ctrl_set_colfx(struct bm2835_
25
26 control = &dev->component[COMP_CAMERA]->control;
27
28 - dev->colourfx.enable = (ctrl->val & 0xff00) >> 8;
29 - dev->colourfx.enable = ctrl->val & 0xff;
30 + dev->colourfx.u = (ctrl->val & 0xff00) >> 8;
31 + dev->colourfx.v = ctrl->val & 0xff;
32
33 ret = vchiq_mmal_port_parameter_set(dev->instance, control,
34 MMAL_PARAMETER_COLOUR_EFFECT,