diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-08-31 06:31:08 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-08-31 08:48:15 -0400 |
commit | 5e49d73c1d87de50353844d263c1c7664aefeec8 (patch) | |
tree | e6b3e64b706e1b586a1d56847671a17c816ef9dc /arch/arm64/include | |
parent | 6a6a4f158037334cbad39817975a87333748c0c2 (diff) |
arm64: cpufeature: constify arm64_ftr_bits structures
The arm64_ftr_bits structures are never modified, so make them read-only.
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r-- | arch/arm64/include/asm/cpufeature.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index 7099f26e3702..7c0b7cff17df 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h | |||
@@ -72,11 +72,11 @@ struct arm64_ftr_bits { | |||
72 | * @sys_val Safe value across the CPUs (system view) | 72 | * @sys_val Safe value across the CPUs (system view) |
73 | */ | 73 | */ |
74 | struct arm64_ftr_reg { | 74 | struct arm64_ftr_reg { |
75 | u32 sys_id; | 75 | u32 sys_id; |
76 | const char *name; | 76 | const char *name; |
77 | u64 strict_mask; | 77 | u64 strict_mask; |
78 | u64 sys_val; | 78 | u64 sys_val; |
79 | struct arm64_ftr_bits *ftr_bits; | 79 | const struct arm64_ftr_bits *ftr_bits; |
80 | }; | 80 | }; |
81 | 81 | ||
82 | /* scope of capability check */ | 82 | /* scope of capability check */ |
@@ -157,7 +157,7 @@ cpuid_feature_extract_unsigned_field(u64 features, int field) | |||
157 | return cpuid_feature_extract_unsigned_field_width(features, field, 4); | 157 | return cpuid_feature_extract_unsigned_field_width(features, field, 4); |
158 | } | 158 | } |
159 | 159 | ||
160 | static inline u64 arm64_ftr_mask(struct arm64_ftr_bits *ftrp) | 160 | static inline u64 arm64_ftr_mask(const struct arm64_ftr_bits *ftrp) |
161 | { | 161 | { |
162 | return (u64)GENMASK(ftrp->shift + ftrp->width - 1, ftrp->shift); | 162 | return (u64)GENMASK(ftrp->shift + ftrp->width - 1, ftrp->shift); |
163 | } | 163 | } |
@@ -170,7 +170,7 @@ cpuid_feature_extract_field(u64 features, int field, bool sign) | |||
170 | cpuid_feature_extract_unsigned_field(features, field); | 170 | cpuid_feature_extract_unsigned_field(features, field); |
171 | } | 171 | } |
172 | 172 | ||
173 | static inline s64 arm64_ftr_value(struct arm64_ftr_bits *ftrp, u64 val) | 173 | static inline s64 arm64_ftr_value(const struct arm64_ftr_bits *ftrp, u64 val) |
174 | { | 174 | { |
175 | return (s64)cpuid_feature_extract_field(val, ftrp->shift, ftrp->sign); | 175 | return (s64)cpuid_feature_extract_field(val, ftrp->shift, ftrp->sign); |
176 | } | 176 | } |