[xen master] x86: remove dead code from cpuid4_cache_lookup()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] x86: remove dead code from cpuid4_cache_lookup()

patchbot
commit 2f374bd557b289e12c793058130169c1d4c46b0a
Author:     Jan Beulich <[hidden email]>
AuthorDate: Mon Jul 2 13:10:52 2018 +0200
Commit:     Jan Beulich <[hidden email]>
CommitDate: Mon Jul 2 13:10:52 2018 +0200

    x86: remove dead code from cpuid4_cache_lookup()
   
    ... and make num_cache_leaves local to the only function using it.
   
    Signed-off-by: Jan Beulich <[hidden email]>
    Reviewed-by: Andrew Cooper <[hidden email]>
---
 xen/arch/x86/cpu/intel_cacheinfo.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/intel_cacheinfo.c b/xen/arch/x86/cpu/intel_cacheinfo.c
index 101e2974bb..4ffcf1b6a0 100644
--- a/xen/arch/x86/cpu/intel_cacheinfo.c
+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -80,8 +80,6 @@ static const struct _cache_table cache_table[] =
  { 0x00, 0, 0}
 };
 
-unsigned short num_cache_leaves;
-
 int cpuid4_cache_lookup(int index, struct cpuid4_info *this_leaf)
 {
  union _cpuid4_leaf_eax eax;
@@ -123,7 +121,7 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c)
  unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
  unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */
  unsigned int new_l2 = 0, new_l3 = 0, i; /* Cache sizes from cpuid(4) */
- unsigned int l2_id = 0, l3_id = 0, num_threads_sharing, index_msb;
+ static unsigned int num_cache_leaves;
 
  if (c->cpuid_level > 3) {
  static int is_initialized;
@@ -156,15 +154,9 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c)
  break;
     case 2:
  new_l2 = this_leaf.size/1024;
- num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
- index_msb = get_count_order(num_threads_sharing);
- l2_id = c->apicid >> index_msb;
  break;
     case 3:
  new_l3 = this_leaf.size/1024;
- num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
- index_msb = get_count_order(num_threads_sharing);
- l3_id = c->apicid >> index_msb;
  break;
     default:
  break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog