Skip to content

Commit ecb6237

Browse files
Julien Gralljgross1
authored andcommitted
x86/xen: Remove undefined behavior in setup_features()
1 << 31 is undefined. So switch to 1U << 31. Fixes: 5ead97c ("xen: Core Xen implementation") Signed-off-by: Julien Grall <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
1 parent f9710c3 commit ecb6237

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/xen/features.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void xen_setup_features(void)
4242
if (HYPERVISOR_xen_version(XENVER_get_features, &fi) < 0)
4343
break;
4444
for (j = 0; j < 32; j++)
45-
xen_features[i * 32 + j] = !!(fi.submap & 1<<j);
45+
xen_features[i * 32 + j] = !!(fi.submap & 1U << j);
4646
}
4747

4848
if (xen_pv_domain()) {

0 commit comments

Comments
 (0)