From 4042df3ded7404d6755c2c0f1ee966fd3798084e Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 11 Dec 2008 16:56:54 +0000 Subject: [PATCH] Strip trailing whitespace and redundant spaces. git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5561 7894878c-1315-0410-8ee3-d5d059ff63e0 --- eeprom/ddcmon | 18 +++++++++--------- eeprom/decode-dimms | 8 ++++---- eeprom/decode-edid | 8 ++++---- eeprom/decode-vaio | 16 ++++++++-------- eeprom/decode-xeon | 30 +++++++++++++++--------------- 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/eeprom/ddcmon b/eeprom/ddcmon index 3c3caf0..0784ae0 100755 --- a/eeprom/ddcmon +++ b/eeprom/ddcmon @@ -77,7 +77,7 @@ sub rawread my $length = shift; my $offset = shift || 0; my $bytes = ''; - + sysopen(FH, $filename, O_RDONLY) or die "Can't open $filename"; if ($offset) @@ -141,14 +141,14 @@ sub print_line sub extract_byte { my ($bytes, $offset) = @_; - + return $bytes->[$offset]; } sub extract_word { my ($bytes, $offset) = @_; - + return ($bytes->[$offset] | ($bytes->[$offset+1] << 8)); } @@ -167,7 +167,7 @@ sub extract_manufacturer sub extract_sesquiword { my ($bytes, $offset) = @_; - + return ($bytes->[$offset] | ($bytes->[$offset+1] << 8) | ($bytes->[$offset+2] << 16)); @@ -176,7 +176,7 @@ sub extract_sesquiword sub extract_dword { my ($bytes, $offset) = @_; - + return ($bytes->[$offset] | ($bytes->[$offset+1] << 8) | ($bytes->[$offset+2] << 16) @@ -220,11 +220,11 @@ sub extract_color_mode return $mode[($bytes->[$offset] >> 3) & 0x03]; } - + sub good_signature { my $bytes = shift; - + return $bytes->[0] == 0x00 && $bytes->[1] == 0xff && $bytes->[2] == 0xff @@ -244,7 +244,7 @@ sub verify_checksum { $cs += $bytes->[$i]; } - + return (($cs & 0xff) == 0 ? 'OK' : 'Not OK'); } @@ -534,7 +534,7 @@ else if (defined($ARGV[0])) { my $error = print_edid($ARGV[0], $address); - + if ($error == 1) { print STDERR diff --git a/eeprom/decode-dimms b/eeprom/decode-dimms index 97eb0f6..91fbf24 100755 --- a/eeprom/decode-dimms +++ b/eeprom/decode-dimms @@ -662,7 +662,7 @@ sub decode_sdr_sdram($) value_or_undefined($bytes->[29], "ns")); printl("Min RAS Pulse Width", - value_or_undefined($bytes->[30], "ns")); + value_or_undefined($bytes->[30], "ns")); $temp = ""; if ($bytes->[31] & 1) { $temp .= "4 MByte\n"; } @@ -1107,7 +1107,7 @@ sub decode_ddr3_sdram($) tns3($bytes->[19] * $mtb)); printl("Minimum Active to Auto-Refresh Delay (tRC)", tns3((((($bytes->[21] >> 4) & 15) << 8) + $bytes->[23]) * $mtb)); - printl("Minimum Recovery Delay (tRFC)", + printl("Minimum Recovery Delay (tRFC)", tns3((($bytes->[25] << 8) + $bytes->[24]) * $mtb)); printl("Minimum Write to Read CMD Delay (tWTR)", tns3($bytes->[26] * $mtb)); @@ -1153,7 +1153,7 @@ sub decode_ddr3_sdram($) prints("Physical Characteristics"); printl("Module Height (mm)", ($bytes->[60] & 31) + 15); printl("Module Thickness (mm)", sprintf("%d front, %d back", - ($bytes->[61] & 15) + 1, + ($bytes->[61] & 15) + 1, (($bytes->[61] >> 4) & 15) +1)); printl("Module Width (mm)", ($bytes->[3] <= 2) ? 133.5 : ($bytes->[3] == 3) ? 67.6 : "TBD"); @@ -1711,7 +1711,7 @@ for my $i ( 0 .. $#dimm_list ) { if exists $decode_callback{$type}; if ($type eq "DDR3 SDRAM") { - # Decode DDR3-specific manufacturing data in bytes + # Decode DDR3-specific manufacturing data in bytes # 117-149 decode_ddr3_mfg_data(\@bytes) } else { diff --git a/eeprom/decode-edid b/eeprom/decode-edid index 15ba1a4..2afc090 100755 --- a/eeprom/decode-edid +++ b/eeprom/decode-edid @@ -80,7 +80,7 @@ sub rawread { my ($filename, $length, $offset) = @_; my $bytes = ''; - + sysopen(FH, $filename, O_RDONLY) or die "Can't open $filename"; if ($offset) @@ -138,9 +138,9 @@ sub bus_detect "decode-edid: using bus $i (autodetected)\n"; return $i; } - } + } } - + return; # default } @@ -163,7 +163,7 @@ sub edid_decode or die "Can't open parse-edid. Please install read-edid.\n"; delete $SIG{__WARN__}; binmode PIPE; - + if ($mode == PROCFS) { for (my $i=0; $i<=0x70; $i+=0x10) diff --git a/eeprom/decode-vaio b/eeprom/decode-vaio index 2631170..f04fe90 100755 --- a/eeprom/decode-vaio +++ b/eeprom/decode-vaio @@ -17,7 +17,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301 USA. # -# EEPROM data decoding for Sony Vaio laptops. +# EEPROM data decoding for Sony Vaio laptops. # # The eeprom driver must be loaded. For kernels older than 2.6.0, the # eeprom driver can be found in the lm-sensors package. @@ -61,7 +61,7 @@ use constant ONLYROOT => "Readable only by root"; sub print_item { my ($label,$value) = @_; - + printf("\%16s : \%s\n",$label,$value); } @@ -71,7 +71,7 @@ sub read_eeprom_bytes { my ($bus, $addr, $offset, $length) = @_; my $filename; - + if ($sysfs) { $filename = "/sys/bus/i2c/devices/$bus-00$addr/eeprom"; @@ -94,7 +94,7 @@ sub read_eeprom_bytes $length -= $r; } close(FH); - + return $bytes; } else @@ -103,7 +103,7 @@ sub read_eeprom_bytes $offset -= $base; my $values = ''; my $remains = $length + $offset; - + # Get all lines in a single string while ($remains > 0) { @@ -116,7 +116,7 @@ sub read_eeprom_bytes $remains -= 16; $base += 16; } - + # Store the useful part in an array my @bytes = split(/[ \n]/, $values); @bytes = @bytes[$offset..$offset+$length-1]; @@ -132,7 +132,7 @@ sub decode_string my $string = read_eeprom_bytes($bus, $addr, $offset, $length); $string =~ s/\x00.*$//; - + return($string); } @@ -180,7 +180,7 @@ sub decode_uuid sub vaio_decode { my ($bus,$addr) = @_; - + my $name = decode_string($bus, $addr, 128, 32); # Simple heuristic to skip false positives return 0 unless $name =~ m/^[A-Z-]{4}/; diff --git a/eeprom/decode-xeon b/eeprom/decode-xeon index 8a400b9..14d83a2 100755 --- a/eeprom/decode-xeon +++ b/eeprom/decode-xeon @@ -6,7 +6,7 @@ # Version 0.1 # # -# ID ROM data decoding for Xeon processors. +# ID ROM data decoding for Xeon processors. # Each Xeon processor contains two memories: # - A scratch EEPROM at an even location 0x50, 52, 54, or 56; # - An ID ROM at an odd location 0x51, 53, 55, or 57. @@ -24,9 +24,9 @@ # Calculate and check checksums for each section # Decode flags in byte 0x7B (cartridge feature flags) # -# References: +# References: # "Pentium II Xeon Processor at 400 and 450 MHz" Data Sheet -# Intel +# Intel # # # @@ -43,7 +43,7 @@ for $i ( 0 .. $#dimm_list ) { $_=$dimm_list[$i]; if ((/^eeprom-/) && (/-51$/ || /-53$/ || /-55$/ || /-57$/)) { $dimm_count=$dimm_count + 1; - + print "\nDecoding Xeon ROM: /proc/sys/dev/sensors/$dimm_list[$i]\n"; if (/^[^-]+-[^-]+-[^-]+-([^-]+)$/) { $dimm_num=($1 - 49) / 2; @@ -54,7 +54,7 @@ for $i ( 0 .. $#dimm_list ) { $_=`cat /proc/sys/dev/sensors/$dimm_list[$i]/00`; @bytes=split(" "); - + printf("\tData Format Revision: \t\t\t\t0x%.4X\n", $bytes[0]); print "\tTotal number of bytes in EEPROM:\t\t"; @@ -69,15 +69,15 @@ for $i ( 0 .. $#dimm_list ) { printf("\tThermal Reference Data Address:\t\t\t0x%.2X\n", $bytes[8]); printf("\tFeature Data Address:\t\t\t\t0x%.2X\n", $bytes[9]); printf("\tOther Data Address:\t\t\t\t0x%.2X\n", $bytes[10]); - + print "\t\t----=== Xeon ROM Processor Data ===----\n"; - + # Decode next 16 bytes $_=`cat /proc/sys/dev/sensors/$dimm_list[$i]/10`; @bbytes=split(" "); - print "\tS-spec/QDF Number:\t\t\t\t\""; + print "\tS-spec/QDF Number:\t\t\t\t\""; print pack("cccccc",$bytes[14],$bytes[15],$bbytes[0], - $bbytes[1],$bbytes[2],$bbytes[3]); + $bbytes[1],$bbytes[2],$bbytes[3]); print "\"\n"; $tmp = $bbytes[4] & 0xC0 >> 6; printf("\tSample / Production:\t\t\t\t0x%.2X", $tmp); @@ -88,7 +88,7 @@ for $i ( 0 .. $#dimm_list ) { } print "\t\t----=== Xeon ROM Core Data ===----\n"; - + printf("\tProcessor Core Type:\t\t\t\t0x%.2X\n", ($bbytes[6] & 0xC0) >> 6); printf("\tProcessor Core Family:\t\t\t\t0x%.2X\n", @@ -100,7 +100,7 @@ for $i ( 0 .. $#dimm_list ) { print "\tMaximum Core Frequency (Mhz):\t\t\t"; print ($bbytes[13] << 4) + $bbytes[14]; print "\n"; - + # Decode next 16 bytes (32-47) $_=`cat /proc/sys/dev/sensors/$dimm_list[$i]/20`; @bytes=split(" "); @@ -115,7 +115,7 @@ for $i ( 0 .. $#dimm_list ) { print "\n"; print "\t\t----=== Xeon ROM L2 Cache Data ===----\n"; - + print "\tL2 Cache Size (KB):\t\t\t\t"; print ($bytes[9] << 4) + $bytes[10]; print "\n"; @@ -173,12 +173,12 @@ for $i ( 0 .. $#dimm_list ) { $bbytes[1],$bbytes[2],$bbytes[3],$bbytes[4]); # Decode next 16 bytes (96-111) -# Not used... +# Not used... # Decode next 16 bytes (112-127) $_=`cat /proc/sys/dev/sensors/$dimm_list[$i]/70`; @bytes=split(" "); - + print "\t\t----=== Xeon Thermal Reference Data ===----\n"; printf("\tThermal Reference Byte: \t\t\t0x%.2X\n", $bytes[0]); @@ -191,7 +191,7 @@ for $i ( 0 .. $#dimm_list ) { $bytes[8],$bytes[9],$bytes[10],$bytes[11]); printf("\tNumber of Devices in TAP Chain:\t\t\t%d\n", ($bytes[12] & 0xF0) >> 4); - + } } print "\n\nNumber of Xeon ROMs detected and decoded: $dimm_count\n";