media: don't do a 31 bit shift on a signed int

On 32-bits archs, a signed integer has 31 bits plus on extra
bit for signal. Due to that, touching the 32th bit with something
like:

	int bar = 1 << 31;

has an undefined behavior in C on 32 bit architectures, as it
touches the signal bit. This is warned by cppcheck.

Instead, force the numbers to be unsigned, in order to solve this
issue.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
Mauro Carvalho Chehab
2019-08-22 11:16:42 -03:00
parent cce8ccca80
commit 95c520690f
19 changed files with 38 additions and 38 deletions

View File

@@ -214,7 +214,7 @@ enum status_config {
FIELD_NO = 0x01 << 28, /* Field number */
DITHER_ON = 0x01 << 29, /* Dithering is on */
ROUND_ON = 0x01 << 30, /* Round is on */
MODE_32BIT = 0x01 << 31, /* Data in RGBa888,
MODE_32BIT = 1UL << 31, /* Data in RGBa888,
* 0 in RGB565
*/
};