diff options
Diffstat (limited to 'arch/x86/kernel/cpu/intel_cacheinfo.c')
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index c7035073dfc1..659643376dbf 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -952,20 +952,18 @@ static ssize_t show_size(struct _cpuid4_info *this_leaf, char *buf, | |||
952 | static ssize_t show_shared_cpu_map_func(struct _cpuid4_info *this_leaf, | 952 | static ssize_t show_shared_cpu_map_func(struct _cpuid4_info *this_leaf, |
953 | int type, char *buf) | 953 | int type, char *buf) |
954 | { | 954 | { |
955 | ptrdiff_t len = PTR_ALIGN(buf + PAGE_SIZE - 1, PAGE_SIZE) - buf; | 955 | const struct cpumask *mask = to_cpumask(this_leaf->shared_cpu_map); |
956 | int n = 0; | 956 | int ret; |
957 | 957 | ||
958 | if (len > 1) { | 958 | if (type) |
959 | const struct cpumask *mask; | 959 | ret = scnprintf(buf, PAGE_SIZE - 1, "%*pbl", |
960 | 960 | cpumask_pr_args(mask)); | |
961 | mask = to_cpumask(this_leaf->shared_cpu_map); | 961 | else |
962 | n = type ? | 962 | ret = scnprintf(buf, PAGE_SIZE - 1, "%*pb", |
963 | cpulist_scnprintf(buf, len-2, mask) : | 963 | cpumask_pr_args(mask)); |
964 | cpumask_scnprintf(buf, len-2, mask); | 964 | buf[ret++] = '\n'; |
965 | buf[n++] = '\n'; | 965 | buf[ret] = '\0'; |
966 | buf[n] = '\0'; | 966 | return ret; |
967 | } | ||
968 | return n; | ||
969 | } | 967 | } |
970 | 968 | ||
971 | static inline ssize_t show_shared_cpu_map(struct _cpuid4_info *leaf, char *buf, | 969 | static inline ssize_t show_shared_cpu_map(struct _cpuid4_info *leaf, char *buf, |