mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
video: Add parentheses around VNBYTES() macro
The VNBYTES() macro needs to have parentheses to prevent some (harmless) macro expansion bugs. The VNBYTES() macro is used like this: VID_TO_PIXEL(x) * VNBYTES(vid_priv->bpix) The * operation is done before the / operation. It still ends up with the same results, but it's not ideal. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
5717528577
commit
cc05d352fb
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ enum video_log2_bpp {
|
|||
* Convert enum video_log2_bpp to bytes and bits. Note we omit the outer
|
||||
* brackets to allow multiplication by fractional pixels.
|
||||
*/
|
||||
#define VNBYTES(bpix) (1 << (bpix)) / 8
|
||||
#define VNBYTES(bpix) ((1 << (bpix)) / 8)
|
||||
|
||||
#define VNBITS(bpix) (1 << (bpix))
|
||||
|
||||
|
|
Loading…
Reference in a new issue