All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sensors-detect: Report proper processor information on ppc
@ 2016-09-26  8:49 Jean Delvare
  2016-09-26 12:58 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Jean Delvare @ 2016-09-26  8:49 UTC (permalink / raw)
  To: linux-hwmon

The format of /proc/cpuinfo on ppc differs from the x86 format. Add
the missing pieces to the parsing code so that ppc processor
information is reported properly.
---
 prog/detect/sensors-detect |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -2864,7 +2864,7 @@ sub initialize_cpu_list
 			};
 			next;
 		}
-		if (m/^(vendor_id|cpu family|model|model name|stepping|cpuid level)\s*:\s*(.+)$/) {
+		if (m/^(vendor_id|cpu family|model|model name|stepping|cpuid level|cpu|revision)\s*:\s*(.+)$/) {
 			my $k = $1;
 			my $v = $2;
 			$v =~ s/\s+/ /g;	# Merge multiple spaces
@@ -2880,7 +2880,11 @@ sub initialize_cpu_list
 sub print_cpu_info
 {
 	my $cpu = $cpu[0];
-	print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n";
+	if (defined  $cpu->{'model name'}) {
+		print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n";
+	} elsif (defined $cpu->{'cpu'}) {	# ppc
+		print "# Processor: $cpu->{'cpu'}, revision $cpu->{'revision'}\n";
+	}
 }
 
 # @i2c_adapters is a list of references to hashes, one hash per I2C/SMBus


-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] sensors-detect: Report proper processor information on ppc
  2016-09-26  8:49 [PATCH] sensors-detect: Report proper processor information on ppc Jean Delvare
@ 2016-09-26 12:58 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2016-09-26 12:58 UTC (permalink / raw)
  To: Jean Delvare, linux-hwmon

On 09/26/2016 01:49 AM, Jean Delvare wrote:
> The format of /proc/cpuinfo on ppc differs from the x86 format. Add
> the missing pieces to the parsing code so that ppc processor
> information is reported properly.
> ---

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

>  prog/detect/sensors-detect |    8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> --- a/prog/detect/sensors-detect
> +++ b/prog/detect/sensors-detect
> @@ -2864,7 +2864,7 @@ sub initialize_cpu_list
>  			};
>  			next;
>  		}
> -		if (m/^(vendor_id|cpu family|model|model name|stepping|cpuid level)\s*:\s*(.+)$/) {
> +		if (m/^(vendor_id|cpu family|model|model name|stepping|cpuid level|cpu|revision)\s*:\s*(.+)$/) {
>  			my $k = $1;
>  			my $v = $2;
>  			$v =~ s/\s+/ /g;	# Merge multiple spaces
> @@ -2880,7 +2880,11 @@ sub initialize_cpu_list
>  sub print_cpu_info
>  {
>  	my $cpu = $cpu[0];
> -	print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n";
> +	if (defined  $cpu->{'model name'}) {
> +		print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n";
> +	} elsif (defined $cpu->{'cpu'}) {	# ppc
> +		print "# Processor: $cpu->{'cpu'}, revision $cpu->{'revision'}\n";
> +	}
>  }
>
>  # @i2c_adapters is a list of references to hashes, one hash per I2C/SMBus
>
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-26 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26  8:49 [PATCH] sensors-detect: Report proper processor information on ppc Jean Delvare
2016-09-26 12:58 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.