Skip to content

Commit

Permalink
Staging: solo6x10: Replace expressions that don't use ALIGN macro
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net>
  • Loading branch information
Andreea-Cristina Bernat authored and ismaell committed May 18, 2014
1 parent 4e02285 commit 1942060
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions solo6x10-v4l2-enc.c
Expand Up @@ -581,8 +581,7 @@ static int solo_fill_jpeg(struct solo_enc_fh *fh, struct videobuf_buffer *vb,
solo_enc->jpeg_header,
solo_enc->jpeg_len);

frame_size = (vh->jpeg_size + solo_enc->jpeg_len + (DMA_ALIGN - 1))
& ~(DMA_ALIGN - 1);
frame_size = ALIGN(vh->jpeg_size + solo_enc->jpeg_len, DMA_ALIGN);

return solo_send_desc(fh, solo_enc->jpeg_len, vbuf, vh->jpeg_off,
frame_size, SOLO_JPEG_EXT_ADDR(solo_dev),
Expand Down Expand Up @@ -622,8 +621,7 @@ static int solo_fill_mpeg(struct solo_enc_fh *fh, struct videobuf_buffer *vb,
/* Now get the actual mpeg payload */
frame_off = (vh->mpeg_off + sizeof(*vh))
% SOLO_MP4E_EXT_SIZE(solo_dev);
frame_size = (vh->mpeg_size + skip + (DMA_ALIGN - 1))
& ~(DMA_ALIGN - 1);
frame_size = ALIGN(vh->mpeg_size + skip, DMA_ALIGN);

return solo_send_desc(fh, skip, vbuf, frame_off, frame_size,
SOLO_MP4E_EXT_ADDR(solo_dev),
Expand Down

0 comments on commit 1942060

Please sign in to comment.