[PATCH v2 2/8] media: solo6x10: Make use of cpu_to_le16_array()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since we have a new helper, let's replace open coded variant by it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Cc: Anton Sviridenko <anton@xxxxxxxxxxxxxxxxxxx>
Cc: Andrey Utkin <andrey.utkin@xxxxxxxxxxxxxxxxxxx>
Cc: Ismael Luceno <ismael@xxxxxxxxxxx>
Cc: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
---
v2: new patch
 drivers/media/pci/solo6x10/solo6x10-disp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/pci/solo6x10/solo6x10-disp.c b/drivers/media/pci/solo6x10/solo6x10-disp.c
index ad98ca7fb98b..09c0cf8a5fcb 100644
--- a/drivers/media/pci/solo6x10/solo6x10-disp.c
+++ b/drivers/media/pci/solo6x10/solo6x10-disp.c
@@ -202,16 +202,15 @@ int solo_set_motion_block(struct solo_dev *solo_dev, u8 ch,
 {
 	const unsigned size = sizeof(u16) * 64;
 	u32 off = SOLO_MOT_FLAG_AREA + ch * SOLO_MOT_THRESH_SIZE * 2;
+	unsigned int y;
 	__le16 *buf;
-	int x, y;
 	int ret = 0;
 
 	buf = kzalloc(size, GFP_KERNEL);
 	if (buf == NULL)
 		return -ENOMEM;
 	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]);
+		cpu_to_le16_array(buf, &thresholds[y * SOLO_MOTION_SZ], SOLO_MOTION_SZ);
 		ret |= solo_p2m_dma(solo_dev, 1, buf,
 			SOLO_MOTION_EXT_ADDR(solo_dev) + off + y * size,
 			size, 0, 0);
-- 
2.28.0




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux