From 88cab8add53983b650e8984250b6f762746a0d04 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 27 Nov 2008 18:10:24 +0000 Subject: [PATCH] Reindent sysfs helpers. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5444 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/sensors-detect | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 1b89d3fc..156d011d 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -2360,28 +2360,29 @@ sub unload_modules ################# # From a sysfs device path, return the driver (module) name, or undef -sub sysfs_device_driver($) +sub sysfs_device_driver { - my $device = shift; + my $device = shift; - my $link = readlink("$device/driver/module"); - return unless defined $link; - return basename($link); + my $link = readlink("$device/driver/module"); + return unless defined $link; + return basename($link); } # From a sysfs device path and an attribute name, return the attribute # value, or undef -sub sysfs_device_attribute($$) +sub sysfs_device_attribute { - my ($device, $attr) = @_; - my $value; + my ($device, $attr) = @_; + my $value; - open(local *FILE, "$device/$attr") or return; - return unless defined($value = ); - close(FILE); + open(local *FILE, "$device/$attr") or return; + $value = ; + close(FILE); + return unless defined $value; - chomp($value); - return $value; + chomp($value); + return $value; } ##############