5ee4c6e98083731bf964343e652685c8b4d547be
[openwrt/staging/zorun.git] /
1 From 375528968ba5e57aef38de6cd4a18af7dbfba9e2 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Wed, 21 Feb 2018 15:28:07 +0000
4 Subject: [PATCH 247/782] staging: bcm2835-camera: Fix multiple line
5 dereference errors
6
7 Fix checkpatch errors "Avoid multiple line dereference"
8
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
10 ---
11 .../bcm2835-camera/bcm2835-camera.c | 41 +++++++------------
12 1 file changed, 14 insertions(+), 27 deletions(-)
13
14 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
15 +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
16 @@ -313,8 +313,7 @@ static void buffer_cleanup(struct vb2_bu
17 static inline bool is_capturing(struct bm2835_mmal_dev *dev)
18 {
19 return dev->capture.camera_port ==
20 - &dev->
21 - component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
22 + &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
23 }
24
25 static void buffer_cb(struct vchiq_mmal_instance *instance,
26 @@ -795,8 +794,7 @@ static int vidioc_overlay(struct file *f
27 return 0; /* already in requested state */
28
29 src =
30 - &dev->component[COMP_CAMERA]->
31 - output[CAM_PORT_PREVIEW];
32 + &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW];
33
34 if (!on) {
35 /* disconnect preview ports and disable component */
36 @@ -853,8 +851,7 @@ static int vidioc_g_fbuf(struct file *fi
37 */
38 struct bm2835_mmal_dev *dev = video_drvdata(file);
39 struct vchiq_mmal_port *preview_port =
40 - &dev->component[COMP_CAMERA]->
41 - output[CAM_PORT_PREVIEW];
42 + &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW];
43
44 a->capability = V4L2_FBUF_CAP_EXTERNOVERLAY |
45 V4L2_FBUF_CAP_GLOBAL_ALPHA;
46 @@ -1046,8 +1043,7 @@ static int mmal_setup_components(struct
47 dev->capture.camera_port, NULL);
48 dev->capture.camera_port = NULL;
49 ret = vchiq_mmal_component_disable(dev->instance,
50 - dev->capture.
51 - encode_component);
52 + dev->capture.encode_component);
53 if (ret)
54 v4l2_err(&dev->v4l2_dev,
55 "Failed to disable encode component %d\n",
56 @@ -1062,26 +1058,22 @@ static int mmal_setup_components(struct
57 if (f->fmt.pix.width <= max_video_width
58 && f->fmt.pix.height <= max_video_height)
59 camera_port = port =
60 - &dev->component[COMP_CAMERA]->
61 - output[CAM_PORT_VIDEO];
62 + &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO];
63 else
64 camera_port = port =
65 - &dev->component[COMP_CAMERA]->
66 - output[CAM_PORT_CAPTURE];
67 + &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
68 break;
69 case COMP_IMAGE_ENCODE:
70 encode_component = dev->component[COMP_IMAGE_ENCODE];
71 port = &dev->component[COMP_IMAGE_ENCODE]->output[0];
72 camera_port =
73 - &dev->component[COMP_CAMERA]->
74 - output[CAM_PORT_CAPTURE];
75 + &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
76 break;
77 case COMP_VIDEO_ENCODE:
78 encode_component = dev->component[COMP_VIDEO_ENCODE];
79 port = &dev->component[COMP_VIDEO_ENCODE]->output[0];
80 camera_port =
81 - &dev->component[COMP_CAMERA]->
82 - output[CAM_PORT_VIDEO];
83 + &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO];
84 break;
85 default:
86 break;
87 @@ -1123,8 +1115,7 @@ static int mmal_setup_components(struct
88
89 if (!ret
90 && camera_port ==
91 - &dev->component[COMP_CAMERA]->
92 - output[CAM_PORT_VIDEO]) {
93 + &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO]) {
94 bool overlay_enabled =
95 !!dev->component[COMP_PREVIEW]->enabled;
96 struct vchiq_mmal_port *preview_port =
97 @@ -1261,9 +1252,8 @@ static int mmal_setup_components(struct
98 port->current_buffer.size);
99 port->current_buffer.size =
100 (f->fmt.pix.sizeimage <
101 - (100 << 10))
102 - ? (100 << 10)
103 - : f->fmt.pix.sizeimage;
104 + (100 << 10)) ?
105 + (100 << 10) : f->fmt.pix.sizeimage;
106 }
107 v4l2_dbg(1, bcm2835_v4l2_debug,
108 &dev->v4l2_dev,
109 @@ -1722,8 +1712,7 @@ static int mmal_init(struct bm2835_mmal_
110
111 /* get the video encoder component ready */
112 ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode",
113 - &dev->
114 - component[COMP_VIDEO_ENCODE]);
115 + &dev->component[COMP_VIDEO_ENCODE]);
116 if (ret < 0)
117 goto unreg_image_encoder;
118
119 @@ -1846,12 +1835,10 @@ static void bcm2835_cleanup_instance(str
120 dev->component[COMP_CAMERA]);
121
122 vchiq_mmal_component_finalise(dev->instance,
123 - dev->
124 - component[COMP_VIDEO_ENCODE]);
125 + dev->component[COMP_VIDEO_ENCODE]);
126
127 vchiq_mmal_component_finalise(dev->instance,
128 - dev->
129 - component[COMP_IMAGE_ENCODE]);
130 + dev->component[COMP_IMAGE_ENCODE]);
131
132 vchiq_mmal_component_finalise(dev->instance,
133 dev->component[COMP_PREVIEW]);