aboutsummaryrefslogtreecommitdiff
path: root/include/sound/sof
diff options
context:
space:
mode:
authorCurtis Malainey <[email protected]>2022-03-04 14:57:31 -0600
committerMark Brown <[email protected]>2022-03-07 13:12:52 +0000
commit4aaa06b227f737da5c10feb93a6b203920d5a1e7 (patch)
treecdd0e2a11cabcd1a9fd2285dc75686cb07d0a6b0 /include/sound/sof
parent8e85cab858562734b9d323f392ba9956bbdc133c (diff)
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 <[email protected]> Reviewed-by: Liam Girdwood <[email protected]> Signed-off-by: Curtis Malainey <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'include/sound/sof')
-rw-r--r--include/sound/sof/header.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/sound/sof/header.h b/include/sound/sof/header.h
index b97a76bcb655..b22e925c70e2 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 */