Skip to content

Commit 0c90f64

Browse files
Hans Verkuilmchehab
authored andcommitted
media: vivid: add vivid_create_queue() helper
Refactor some of the vivid_create_instance code by using a new vivid_create_queue() helper function. Also add some sanity checks for the node_types vs input/output_types module options. This patch resolves these two smatch parse errors: drivers/media/platform/vivid/vivid-core.c:1679 vivid_create_instance() parse error: OOM: 3002600Kb sm_state_count = 6160113 drivers/media/platform/vivid/vivid-core.c: drivers/media/platform/vivid/vivid-core.c:1679 vivid_create_instance() parse error: __split_smt: function too hairy. Giving up after 33 seconds Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent 1318372 commit 0c90f64

3 files changed

Lines changed: 116 additions & 149 deletions

File tree

‎drivers/media/platform/vivid/vivid-cec.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,11 @@ struct cec_adapter *vivid_cec_alloc_adap(struct vivid_dev *dev,
276276
unsigned int idx,
277277
bool is_source)
278278
{
279-
char name[sizeof(dev->vid_out_dev.name) + 2];
280279
u32 caps = CEC_CAP_DEFAULTS | CEC_CAP_MONITOR_ALL | CEC_CAP_MONITOR_PIN;
280+
char name[32];
281281

282-
snprintf(name, sizeof(name), "%s%d",
283-
is_source ? dev->vid_out_dev.name : dev->vid_cap_dev.name,
284-
idx);
282+
snprintf(name, sizeof(name), "vivid-%03d-vid-%s%d",
283+
dev->inst, is_source ? "out" : "cap", idx);
285284
return cec_allocate_adapter(&vivid_cec_adap_ops, dev,
286285
name, caps, 1);
287286
}

0 commit comments

Comments
 (0)