diff options
author | Andreea-Cristina Bernat <bernat.ada@gmail.com> | 2014-03-16 18:00:01 -0700 |
---|---|---|
committer | Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> | 2014-03-16 18:00:56 -0700 |
commit | 0cb6dfd710b00865258d1a70e9b62f3343a81b68 (patch) | |
tree | 39720e49407223ad9fcdd6503ece19bdb62bd873 /drivers/staging | |
parent | 8fa7fdeb62373f9bfd364d84d83de1c731b3f7c9 (diff) |
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: Andreea-Cristina Bernat <bernat.ada@gmail.com>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c b/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c index 6dc32f65555f..5aeb9c0c2781 100644 --- a/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c +++ b/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c @@ -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) return -EIO; - frame_size = (vop_jpeg_size(vh) + solo_enc->jpeg_len + (DMA_ALIGN - 1)) - & ~(DMA_ALIGN - 1); + frame_size = ALIGN(vop_jpeg_size(vh) + solo_enc->jpeg_len, DMA_ALIGN); vb2_set_plane_payload(vb, 0, vop_jpeg_size(vh) + solo_enc->jpeg_len); /* may discard all previous data in vbuf->sgl */ @@ -521,8 +520,7 @@ static int solo_fill_mpeg(struct solo_enc_dev *solo_enc, /* Now get the actual mpeg payload */ frame_off = (vop_mpeg_offset(vh) - SOLO_MP4E_EXT_ADDR(solo_dev) + sizeof(*vh)) % SOLO_MP4E_EXT_SIZE(solo_dev); - frame_size = (vop_mpeg_size(vh) + skip + (DMA_ALIGN - 1)) - & ~(DMA_ALIGN - 1); + frame_size = ALIGN(vop_mpeg_size(vh) + skip, DMA_ALIGN); /* may discard all previous data in vbuf->sgl */ dma_map_sg(&solo_dev->pdev->dev, vbuf->sgl, vbuf->nents, |