diff options
author | Dan Carpenter | 2023-07-26 09:54:08 +0300 |
---|---|---|
committer | Tom Rini | 2023-08-08 17:05:43 -0400 |
commit | cc05d352fbc2b5df7f3aa4bd8a0711df5a1efa68 (patch) | |
tree | 12b36eac0b631c7aa488c4ea4def8d996da9671b /include/video.h | |
parent | 57175285774751ca751d3d5e9f045d6af95ea43b (diff) |
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>
Diffstat (limited to 'include/video.h')
-rw-r--r-- | include/video.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/video.h b/include/video.h index 269915160b4..66d109ca5da 100644 --- a/include/video.h +++ b/include/video.h @@ -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)) |