Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mfd: macsmc: Add new __SMC_KEY macro

When using the _SMC_KEY macro in switch/case statements, GCC 15.2.1 errors
out with 'case label does not reduce to an integer constant'. Introduce
a new __SMC_KEY macro that can be used instead.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Link: https://patch.msgid.link/20251025-macsmc-subdevs-v4-5-374d5c9eba0e@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

James Calligeros and committed by
Lee Jones
b340412a 3a866087

+1
+1
include/linux/mfd/macsmc.h
··· 41 41 */ 42 42 #define SMC_KEY(s) (smc_key)(_SMC_KEY(#s)) 43 43 #define _SMC_KEY(s) (((s)[0] << 24) | ((s)[1] << 16) | ((s)[2] << 8) | (s)[3]) 44 + #define __SMC_KEY(a, b, c, d) (((u32)(a) << 24) | ((u32)(b) << 16) | ((u32)(c) << 8) | ((u32)(d))) 44 45 45 46 #define APPLE_SMC_READABLE BIT(7) 46 47 #define APPLE_SMC_WRITABLE BIT(6)