lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2026020556-deprive-icky-9cd1@gregkh>
Date: Thu, 5 Feb 2026 17:25:03 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Nikolay Kuratov <kniv@...dex-team.ru>
Cc: stable@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-pm@...r.kernel.org,
	Patryk Wlazlyn <patryk.wlazlyn@...ux.intel.com>,
	Len Brown <lenb@...nel.org>
Subject: Re: [PATCH 6.12] tools/power turbostat: Fix compilation on older
 compilers

On Thu, Feb 05, 2026 at 06:59:07PM +0300, Nikolay Kuratov wrote:
> Currently turbostat.c can't be built on pre-gcc-11 compilers
> due to error: a label can only be part of a statement and a declaration
> is not a statement.
> 
> Fix this by adding braces around case labels.
> 
> Fixes: 640540beb883 ("tools/power turbostat: Add MTL's PMT DC6 builtin counter")
> Signed-off-by: Nikolay Kuratov <kniv@...dex-team.ru>
> ---
>  tools/power/x86/turbostat/turbostat.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
> index b663a76d31f1..85d40d3c6384 100644
> --- a/tools/power/x86/turbostat/turbostat.c
> +++ b/tools/power/x86/turbostat/turbostat.c
> @@ -2799,7 +2799,7 @@ int format_counters(struct thread_data *t, struct core_data *c, struct pkg_data
>  
>  	for (i = 0, ppmt = sys.pmt_tp; ppmt; i++, ppmt = ppmt->next) {
>  		switch (ppmt->type) {
> -		case PMT_TYPE_RAW:
> +		case PMT_TYPE_RAW: {
>  			if (pmt_counter_get_width(ppmt) <= 32)
>  				outp += sprintf(outp, "%s0x%08x", (printed++ ? delim : ""),
>  						(unsigned int)t->pmt_counter[i]);
> @@ -2807,14 +2807,14 @@ int format_counters(struct thread_data *t, struct core_data *c, struct pkg_data
>  				outp += sprintf(outp, "%s0x%016llx", (printed++ ? delim : ""), t->pmt_counter[i]);
>  
>  			break;
> -
> -		case PMT_TYPE_XTAL_TIME:
> +		}
> +		case PMT_TYPE_XTAL_TIME: {
>  			const unsigned long value_raw = t->pmt_counter[i];
>  			const double value_converted = 100.0 * value_raw / crystal_hz / interval_float;
>  
>  			outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), value_converted);
>  			break;
> -		}
> +		}}
>  	}
>  
>  	/* C1 */
> @@ -2880,7 +2880,7 @@ int format_counters(struct thread_data *t, struct core_data *c, struct pkg_data
>  
>  	for (i = 0, ppmt = sys.pmt_cp; ppmt; i++, ppmt = ppmt->next) {
>  		switch (ppmt->type) {
> -		case PMT_TYPE_RAW:
> +		case PMT_TYPE_RAW: {
>  			if (pmt_counter_get_width(ppmt) <= 32)
>  				outp += sprintf(outp, "%s0x%08x", (printed++ ? delim : ""),
>  						(unsigned int)c->pmt_counter[i]);
> @@ -2888,14 +2888,14 @@ int format_counters(struct thread_data *t, struct core_data *c, struct pkg_data
>  				outp += sprintf(outp, "%s0x%016llx", (printed++ ? delim : ""), c->pmt_counter[i]);
>  
>  			break;
> -
> -		case PMT_TYPE_XTAL_TIME:
> +		}
> +		case PMT_TYPE_XTAL_TIME: {
>  			const unsigned long value_raw = c->pmt_counter[i];
>  			const double value_converted = 100.0 * value_raw / crystal_hz / interval_float;
>  
>  			outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), value_converted);
>  			break;
> -		}
> +		}}
>  	}
>  
>  	fmt8 = "%s%.2f";
> @@ -3079,7 +3079,7 @@ int format_counters(struct thread_data *t, struct core_data *c, struct pkg_data
>  
>  	for (i = 0, ppmt = sys.pmt_pp; ppmt; i++, ppmt = ppmt->next) {
>  		switch (ppmt->type) {
> -		case PMT_TYPE_RAW:
> +		case PMT_TYPE_RAW: {
>  			if (pmt_counter_get_width(ppmt) <= 32)
>  				outp += sprintf(outp, "%s0x%08x", (printed++ ? delim : ""),
>  						(unsigned int)p->pmt_counter[i]);
> @@ -3087,14 +3087,14 @@ int format_counters(struct thread_data *t, struct core_data *c, struct pkg_data
>  				outp += sprintf(outp, "%s0x%016llx", (printed++ ? delim : ""), p->pmt_counter[i]);
>  
>  			break;
> -
> -		case PMT_TYPE_XTAL_TIME:
> +		}
> +		case PMT_TYPE_XTAL_TIME: {
>  			const unsigned long value_raw = p->pmt_counter[i];
>  			const double value_converted = 100.0 * value_raw / crystal_hz / interval_float;
>  
>  			outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), value_converted);
>  			break;
> -		}
> +		}}
>  	}
>  
>  done:
> -- 
> 2.34.1
> 
> 

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ