Commit f0cf9985 authored by Bixuan Cui's avatar Bixuan Cui Committed by Mauro Carvalho Chehab
Browse files

media: tuners: reduce stack usage in mxl5005s_reconfigure



Fix the warning: [-Werror=-Wframe-larger-than=]

drivers/media/tuners/mxl5005s.c: In function 'mxl5005s_reconfigure':
drivers/media/tuners/mxl5005s.c:3953:1:
warning: the frame size of 1152 bytes is larger than 1024 bytes

Signed-off-by: default avatarBixuan Cui <cuibixuan@huawei.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 965045ca
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -3926,15 +3926,26 @@ static int mxl5005s_reconfigure(struct dvb_frontend *fe, u32 mod_type,
	u32 bandwidth)
{
	struct mxl5005s_state *state = fe->tuner_priv;

	u8 AddrTable[MXL5005S_REG_WRITING_TABLE_LEN_MAX];
	u8 ByteTable[MXL5005S_REG_WRITING_TABLE_LEN_MAX];
	u8 *AddrTable;
	u8 *ByteTable;
	int TableLen;

	dprintk(1, "%s(type=%d, bw=%d)\n", __func__, mod_type, bandwidth);

	mxl5005s_reset(fe);

	AddrTable = kcalloc(MXL5005S_REG_WRITING_TABLE_LEN_MAX, sizeof(u8),
			    GFP_KERNEL);
	if (!AddrTable)
		return -ENOMEM;

	ByteTable = kcalloc(MXL5005S_REG_WRITING_TABLE_LEN_MAX, sizeof(u8),
			    GFP_KERNEL);
	if (!ByteTable) {
		kfree(AddrTable);
		return -ENOMEM;
	}

	/* Tuner initialization stage 0 */
	MXL_GetMasterControl(ByteTable, MC_SYNTH_RESET);
	AddrTable[0] = MASTER_CONTROL_ADDR;
@@ -3949,6 +3960,9 @@ static int mxl5005s_reconfigure(struct dvb_frontend *fe, u32 mod_type,

	mxl5005s_writeregs(fe, AddrTable, ByteTable, TableLen);

	kfree(AddrTable);
	kfree(ByteTable);

	return 0;
}