Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 761f9aa2 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] solo6x10: fix 'dma from stack' warning

parent 316d9e84
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -213,19 +213,21 @@ int solo_set_motion_threshold(struct solo_dev *solo_dev, u8 ch, u16 val)
int solo_set_motion_block(struct solo_dev *solo_dev, u8 ch,
		const u16 *thresholds)
{
	const unsigned size = sizeof(u16) * 64;
	u32 off = SOLO_MOT_FLAG_AREA + ch * SOLO_MOT_THRESH_SIZE * 2;
	u16 buf[64];
	u16 *buf;
	int x, y;
	int ret = 0;

	memset(buf, 0, sizeof(buf));
	buf = kzalloc(size, GFP_KERNEL);
	for (y = 0; y < SOLO_MOTION_SZ; y++) {
		for (x = 0; x < SOLO_MOTION_SZ; x++)
			buf[x] = cpu_to_le16(thresholds[y * SOLO_MOTION_SZ + x]);
		ret |= solo_p2m_dma(solo_dev, 1, buf,
			SOLO_MOTION_EXT_ADDR(solo_dev) + off + y * sizeof(buf),
			sizeof(buf), 0, 0);
			SOLO_MOTION_EXT_ADDR(solo_dev) + off + y * size,
			size, 0, 0);
	}
	kfree(buf);
	return ret;
}