From: Dan Carpenter Date: Wed, 26 Jul 2023 06:54:08 +0000 (+0300) Subject: video: Add parentheses around VNBYTES() macro X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=cc05d352fbc2b5df7f3aa4bd8a0711df5a1efa68;p=u-boot.git 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 Reviewed-by: Simon Glass --- diff --git a/include/video.h b/include/video.h index 269915160b..66d109ca5d 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))