[PATCH] x86/Intel: re-indent family 6 switch() in intel_log_freq()

Jan Beulich posted 1 patch 2 years, 2 months ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/92d00aea-9984-3940-2e2a-d54281e4c3a1@suse.com
[PATCH] x86/Intel: re-indent family 6 switch() in intel_log_freq()
Posted by Jan Beulich 2 years, 2 months ago
This was left at its previous indentation by e6e3cf191d37 ("x86/Intel:
also display CPU freq for family 0xf") to ease review. Remove the now
unnecessary level of indentation.

No functional change.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -468,35 +468,33 @@ static void intel_log_freq(const struct
         if ( !max_ratio )
             return;
 
+        switch ( c->x86_model )
         {
-            switch ( c->x86_model )
-            {
-            case 0x0e: /* Core */
-            case 0x0f: case 0x16: case 0x17: case 0x1d: /* Core2 */
-                /*
-                 * PLATFORM_INFO, while not documented for these, appears to
-                 * exist in at least some cases, but what it holds doesn't
-                 * match the scheme used by newer CPUs.  At a guess, the min
-                 * and max fields look to be reversed, while the scaling
-                 * factor is encoded in FSB_FREQ.
-                 */
-                if ( min_ratio > max_ratio )
-                    SWAP(min_ratio, max_ratio);
-                if ( rdmsr_safe(MSR_FSB_FREQ, msrval) ||
-                     (msrval &= 7) >= ARRAY_SIZE(core_factors) )
-                    return;
-                factor = core_factors[msrval];
-                break;
+        case 0x0e: /* Core */
+        case 0x0f: case 0x16: case 0x17: case 0x1d: /* Core2 */
+            /*
+             * PLATFORM_INFO, while not documented for these, appears to exist
+             * in at least some cases, but what it holds doesn't match the
+             * scheme used by newer CPUs.  At a guess, the min and max fields
+             * look to be reversed, while the scaling factor is encoded in
+             * FSB_FREQ.
+             */
+            if ( min_ratio > max_ratio )
+                SWAP(min_ratio, max_ratio);
+            if ( rdmsr_safe(MSR_FSB_FREQ, msrval) ||
+                 (msrval &= 7) >= ARRAY_SIZE(core_factors) )
+                return;
+            factor = core_factors[msrval];
+            break;
 
-            case 0x1a: case 0x1e: case 0x1f: case 0x2e: /* Nehalem */
-            case 0x25: case 0x2c: case 0x2f: /* Westmere */
-                factor = 13333;
-                break;
+        case 0x1a: case 0x1e: case 0x1f: case 0x2e: /* Nehalem */
+        case 0x25: case 0x2c: case 0x2f: /* Westmere */
+            factor = 13333;
+            break;
 
-            default:
-                factor = 10000;
-                break;
-            }
+        default:
+            factor = 10000;
+            break;
         }
         break;
 


Re: [PATCH] x86/Intel: re-indent family 6 switch() in intel_log_freq()
Posted by Roger Pau Monné 2 years, 2 months ago
On Mon, Feb 14, 2022 at 10:18:47AM +0100, Jan Beulich wrote:
> This was left at its previous indentation by e6e3cf191d37 ("x86/Intel:
> also display CPU freq for family 0xf") to ease review. Remove the now
> unnecessary level of indentation.
> 
> No functional change.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks, Roger.