Commit 62e7244
x86/cpu: Make sure flag_is_changeable_p() is always being used
When flag_is_changeable_p() is unused, it prevents kernel builds
with clang, `make W=1` and CONFIG_WERROR=y:
arch/x86/kernel/cpu/common.c:351:19: error: unused function 'flag_is_changeable_p' [-Werror,-Wunused-function]
351 | static inline int flag_is_changeable_p(u32 flag)
| ^~~~~~~~~~~~~~~~~~~~
Fix this by moving core around to make sure flag_is_changeable_p() is
always being used.
See also commit 6863f56 ("kbuild: allow Clang to find unused static
inline functions for W=1 build").
While at it, fix the argument type to be unsigned long along with
the local variables, although it currently only runs in 32-bit cases.
Besides that, makes it return boolean instead of int. This induces
the change of the returning type of have_cpuid_p() to be boolean
as well.
Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Link: https://lore.kernel.org/all/20241108153105.1578186-1-andriy.shevchenko%40linux.intel.com1 parent 86e39b9 commit 62e7244
2 files changed
+23
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
24 | 26 | | |
25 | | - | |
| 27 | + | |
26 | 28 | | |
27 | | - | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | 278 | | |
290 | | - | |
| 279 | + | |
291 | 280 | | |
292 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
293 | 285 | | |
294 | 286 | | |
295 | 287 | | |
| |||
312 | 304 | | |
313 | 305 | | |
314 | 306 | | |
315 | | - | |
| 307 | + | |
316 | 308 | | |
317 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
318 | 321 | | |
319 | | - | |
| 322 | + | |
320 | 323 | | |
321 | 324 | | |
322 | 325 | | |
| |||
348 | 351 | | |
349 | 352 | | |
350 | 353 | | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | 354 | | |
356 | 355 | | |
357 | 356 | | |
| |||
1087 | 1086 | | |
1088 | 1087 | | |
1089 | 1088 | | |
1090 | | - | |
1091 | 1089 | | |
1092 | 1090 | | |
1093 | 1091 | | |
| |||
1108 | 1106 | | |
1109 | 1107 | | |
1110 | 1108 | | |
1111 | | - | |
1112 | 1109 | | |
1113 | 1110 | | |
1114 | 1111 | | |
| |||
0 commit comments