From: Curtis Malainey Date: Fri, 4 Mar 2022 20:57:31 +0000 (-0600) Subject: ASoC: SOF: fix 32 signed bit overflow X-Git-Tag: baikal/aarch64/sdk6.1~4422^2~7^2~55^2~2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=e1da88f2412a67e75890cfbb32c46e585f45f09e;p=kernel.git ASoC: SOF: fix 32 signed bit overflow Shifting in a signed 32bit container past the signed bit is technically undefined behaviour. Fix by using unsigned types. Found via cppcheck. Reviewed-by: Ranjani Sridharan Reviewed-by: Liam Girdwood Signed-off-by: Curtis Malainey Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220304205733.62233-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/include/sound/sof/header.h b/include/sound/sof/header.h index b97a76bcb6555..b22e925c70e27 100644 --- a/include/sound/sof/header.h +++ b/include/sound/sof/header.h @@ -31,7 +31,7 @@ /* Global Message - Generic */ #define SOF_GLB_TYPE_SHIFT 28 -#define SOF_GLB_TYPE_MASK (0xfL << SOF_GLB_TYPE_SHIFT) +#define SOF_GLB_TYPE_MASK (0xfUL << SOF_GLB_TYPE_SHIFT) #define SOF_GLB_TYPE(x) ((x) << SOF_GLB_TYPE_SHIFT) /* Command Message - Generic */ diff --git a/include/uapi/sound/sof/abi.h b/include/uapi/sound/sof/abi.h index f4232d289a22b..e052653a6e4cc 100644 --- a/include/uapi/sound/sof/abi.h +++ b/include/uapi/sound/sof/abi.h @@ -27,7 +27,7 @@ /* SOF ABI version major, minor and patch numbers */ #define SOF_ABI_MAJOR 3 #define SOF_ABI_MINOR 19 -#define SOF_ABI_PATCH 0 +#define SOF_ABI_PATCH 1 /* SOF ABI version number. Format within 32bit word is MMmmmppp */ #define SOF_ABI_MAJOR_SHIFT 24