Commit 05c480f4 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

media: media/cec: use CEC_MAX_MSG_SIZE instead of hardcoded 16



Use the proper define for the maximum CEC message length instead of
hardcoding it.

Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 107ca18c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -256,8 +256,8 @@ static void stih_rx_done(struct stih_cec *cec, u32 status)
	if (!msg.len)
		return;

	if (msg.len > 16)
		msg.len = 16;
	if (msg.len > CEC_MAX_MSG_SIZE)
		msg.len = CEC_MAX_MSG_SIZE;

	for (i = 0; i < msg.len; i++)
		msg.msg[i] = readl(cec->regs + CEC_RX_DATA_BASE + i);
+2 −2
Original line number Diff line number Diff line
@@ -943,8 +943,8 @@ static int adv7511_isr(struct v4l2_subdev *sd, u32 status, bool *handled)
		v4l2_dbg(1, debug, sd, "%s: cec msg len %d\n", __func__,
			 msg.len);

		if (msg.len > 16)
			msg.len = 16;
		if (msg.len > CEC_MAX_MSG_SIZE)
			msg.len = CEC_MAX_MSG_SIZE;

		if (msg.len) {
			u8 i;
+2 −2
Original line number Diff line number Diff line
@@ -2047,8 +2047,8 @@ static void adv76xx_cec_isr(struct v4l2_subdev *sd, bool *handled)
		struct cec_msg msg;

		msg.len = cec_read(sd, 0x25) & 0x1f;
		if (msg.len > 16)
			msg.len = 16;
		if (msg.len > CEC_MAX_MSG_SIZE)
			msg.len = CEC_MAX_MSG_SIZE;

		if (msg.len) {
			u8 i;
+2 −2
Original line number Diff line number Diff line
@@ -2215,8 +2215,8 @@ static void adv7842_cec_isr(struct v4l2_subdev *sd, bool *handled)
		struct cec_msg msg;

		msg.len = cec_read(sd, 0x25) & 0x1f;
		if (msg.len > 16)
			msg.len = 16;
		if (msg.len > CEC_MAX_MSG_SIZE)
			msg.len = CEC_MAX_MSG_SIZE;

		if (msg.len) {
			u8 i;