Skip to content

Commit 8c176e1

Browse files
amitdanielkachhapctmarinas
authored andcommitted
arm64: cpufeature: Move cpu capability helpers inside C file
These helpers are used only by functions inside cpufeature.c and hence makes sense to be moved from cpufeature.h to cpufeature.c as they are not expected to be used globally. This change helps in reducing the header file size as well as to add future cpu capability types without confusion. Only a cpu capability type macro is sufficient to expose those capabilities globally. Signed-off-by: Amit Daniel Kachhap <[email protected]> Reviewed-by: Vincenzo Frascino <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent df35510 commit 8c176e1

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

arch/arm64/include/asm/cpufeature.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -340,18 +340,6 @@ static inline int cpucap_default_scope(const struct arm64_cpu_capabilities *cap)
340340
return cap->type & ARM64_CPUCAP_SCOPE_MASK;
341341
}
342342

343-
static inline bool
344-
cpucap_late_cpu_optional(const struct arm64_cpu_capabilities *cap)
345-
{
346-
return !!(cap->type & ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU);
347-
}
348-
349-
static inline bool
350-
cpucap_late_cpu_permitted(const struct arm64_cpu_capabilities *cap)
351-
{
352-
return !!(cap->type & ARM64_CPUCAP_PERMITTED_FOR_LATE_CPU);
353-
}
354-
355343
/*
356344
* Generic helper for handling capabilties with multiple (match,enable) pairs
357345
* of call backs, sharing the same capability bit.

arch/arm64/kernel/cpufeature.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,19 @@ static bool can_use_gic_priorities(const struct arm64_cpu_capabilities *entry,
13631363
}
13641364
#endif
13651365

1366+
/* Internal helper functions to match cpu capability type */
1367+
static bool
1368+
cpucap_late_cpu_optional(const struct arm64_cpu_capabilities *cap)
1369+
{
1370+
return !!(cap->type & ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU);
1371+
}
1372+
1373+
static bool
1374+
cpucap_late_cpu_permitted(const struct arm64_cpu_capabilities *cap)
1375+
{
1376+
return !!(cap->type & ARM64_CPUCAP_PERMITTED_FOR_LATE_CPU);
1377+
}
1378+
13661379
static const struct arm64_cpu_capabilities arm64_features[] = {
13671380
{
13681381
.desc = "GIC system register CPU interface",

0 commit comments

Comments
 (0)