1 From 792e9e31a64c32d70b79afaa24d9ad3e96a39ff6 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 398/454] staging: bcm2835-camera: Fix multiple line
7 Fix checkpatch errors "Avoid multiple line dereference"
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
11 .../bcm2835-camera/bcm2835-camera.c | 41 +++++++------------
12 1 file changed, 14 insertions(+), 27 deletions(-)
14 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
15 +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
16 @@ -320,8 +320,7 @@ static void buffer_cleanup(struct vb2_bu
17 static inline bool is_capturing(struct bm2835_mmal_dev *dev)
19 return dev->capture.camera_port ==
21 - component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
22 + &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
25 static void buffer_cb(struct vchiq_mmal_instance *instance,
26 @@ -804,8 +803,7 @@ static int vidioc_overlay(struct file *f
27 return 0; /* already in requested state */
30 - &dev->component[COMP_CAMERA]->
31 - output[CAM_PORT_PREVIEW];
32 + &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW];
35 /* disconnect preview ports and disable component */
36 @@ -860,8 +858,7 @@ static int vidioc_g_fbuf(struct file *fi
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];
44 a->capability = V4L2_FBUF_CAP_EXTERNOVERLAY |
45 V4L2_FBUF_CAP_GLOBAL_ALPHA;
46 @@ -1053,8 +1050,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,
52 + dev->capture.encode_component);
54 v4l2_err(&dev->v4l2_dev,
55 "Failed to disable encode component %d\n",
56 @@ -1069,26 +1065,22 @@ static int mmal_setup_components(struct
57 if (f->fmt.pix.width <= max_video_width
58 && f->fmt.pix.height <= max_video_height)
60 - &dev->component[COMP_CAMERA]->
61 - output[CAM_PORT_VIDEO];
62 + &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO];
65 - &dev->component[COMP_CAMERA]->
66 - output[CAM_PORT_CAPTURE];
67 + &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
69 case COMP_IMAGE_ENCODE:
70 encode_component = dev->component[COMP_IMAGE_ENCODE];
71 port = &dev->component[COMP_IMAGE_ENCODE]->output[0];
73 - &dev->component[COMP_CAMERA]->
74 - output[CAM_PORT_CAPTURE];
75 + &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
77 case COMP_VIDEO_ENCODE:
78 encode_component = dev->component[COMP_VIDEO_ENCODE];
79 port = &dev->component[COMP_VIDEO_ENCODE]->output[0];
81 - &dev->component[COMP_CAMERA]->
82 - output[CAM_PORT_VIDEO];
83 + &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO];
87 @@ -1130,8 +1122,7 @@ static int mmal_setup_components(struct
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 @@ -1268,9 +1259,8 @@ static int mmal_setup_components(struct
98 port->current_buffer.size);
99 port->current_buffer.size =
100 (f->fmt.pix.sizeimage <
103 - : f->fmt.pix.sizeimage;
105 + (100 << 10) : f->fmt.pix.sizeimage;
107 v4l2_dbg(1, bcm2835_v4l2_debug,
109 @@ -1721,8 +1711,7 @@ static int __init mmal_init(struct bm283
111 /* get the video encoder component ready */
112 ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode",
114 - component[COMP_VIDEO_ENCODE]);
115 + &dev->component[COMP_VIDEO_ENCODE]);
117 goto unreg_image_encoder;
119 @@ -1842,12 +1831,10 @@ static void bcm2835_cleanup_instance(str
120 dev->component[COMP_CAMERA]);
122 vchiq_mmal_component_finalise(dev->instance,
124 - component[COMP_VIDEO_ENCODE]);
125 + dev->component[COMP_VIDEO_ENCODE]);
127 vchiq_mmal_component_finalise(dev->instance,
129 - component[COMP_IMAGE_ENCODE]);
130 + dev->component[COMP_IMAGE_ENCODE]);
132 vchiq_mmal_component_finalise(dev->instance,
133 dev->component[COMP_PREVIEW]);