Commit 0cb6dfd7 authored by Andreea-Cristina Bernat's avatar Andreea-Cristina Bernat Committed by Peter P Waskiewicz Jr

Staging: solo6x10: Replace expressions that don't use ALIGN macro

There are some expressions that compute the roundup of a number, but don't use
the existing macro defined in /include/kernel.h. This patch uses the following
Coccinelle semantic patch:
@ haskernel @
@@

@ depends on haskernel @
expression E1, E2;
@@

- (E1 + (E2 - 1)) & ~(E2 - 1)
+ ALIGN(E1, E2)
Signed-off-by: default avatarAndreea-Cristina Bernat <bernat.ada@gmail.com>
Acked-by: default avatarBob Copeland <me@bobcopeland.com>
Signed-off-by: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
parent 8fa7fdeb
...@@ -472,8 +472,7 @@ static int solo_fill_jpeg(struct solo_enc_dev *solo_enc, ...@@ -472,8 +472,7 @@ static int solo_fill_jpeg(struct solo_enc_dev *solo_enc,
if (vb2_plane_size(vb, 0) < vop_jpeg_size(vh) + solo_enc->jpeg_len) if (vb2_plane_size(vb, 0) < vop_jpeg_size(vh) + solo_enc->jpeg_len)
return -EIO; return -EIO;
frame_size = (vop_jpeg_size(vh) + solo_enc->jpeg_len + (DMA_ALIGN - 1)) frame_size = ALIGN(vop_jpeg_size(vh) + solo_enc->jpeg_len, DMA_ALIGN);
& ~(DMA_ALIGN - 1);
vb2_set_plane_payload(vb, 0, vop_jpeg_size(vh) + solo_enc->jpeg_len); vb2_set_plane_payload(vb, 0, vop_jpeg_size(vh) + solo_enc->jpeg_len);
/* may discard all previous data in vbuf->sgl */ /* may discard all previous data in vbuf->sgl */
...@@ -521,8 +520,7 @@ static int solo_fill_mpeg(struct solo_enc_dev *solo_enc, ...@@ -521,8 +520,7 @@ static int solo_fill_mpeg(struct solo_enc_dev *solo_enc,
/* Now get the actual mpeg payload */ /* Now get the actual mpeg payload */
frame_off = (vop_mpeg_offset(vh) - SOLO_MP4E_EXT_ADDR(solo_dev) + frame_off = (vop_mpeg_offset(vh) - SOLO_MP4E_EXT_ADDR(solo_dev) +
sizeof(*vh)) % SOLO_MP4E_EXT_SIZE(solo_dev); sizeof(*vh)) % SOLO_MP4E_EXT_SIZE(solo_dev);
frame_size = (vop_mpeg_size(vh) + skip + (DMA_ALIGN - 1)) frame_size = ALIGN(vop_mpeg_size(vh) + skip, DMA_ALIGN);
& ~(DMA_ALIGN - 1);
/* may discard all previous data in vbuf->sgl */ /* may discard all previous data in vbuf->sgl */
dma_map_sg(&solo_dev->pdev->dev, vbuf->sgl, vbuf->nents, dma_map_sg(&solo_dev->pdev->dev, vbuf->sgl, vbuf->nents,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment