tuningsysfs patches
Sergey Senozhatsky
cover tuningsysfs patches
Hello,
two small patches in -next.
tuningsysfs:
- fix tuningsysfs typo
- use process_directory() helper function
please pull from:
https://github.com/sergey-senozhatsky/powertop2-next.git
Sergey Senozhatsky (2):
tuningsysfs: fix msg typo
tuningsysfs: use lib process_directory() helper
src/tuning/tuningsysfs.cpp | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-)
Signature · 1 line
1.8.5.rc3.362.gdf10213.dirty
Sergey Senozhatsky
PATCH 1/2 tuningsysfs: fix msg typo
fix 'Managmenet' typo.
--- src/tuning/tuningsysfs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/tuning/tuningsysfs.cpp +1 -1
@@ -136,7 +136,7 @@ void add_sata_tunables(void) sprintf(filename, "/sys/class/scsi_host/%s/link_power_management_policy", entry->d_name); - sprintf(msg, _("Enable SATA link power Managmenet for %s"),entry->d_name); + sprintf(msg, _("Enable SATA link power management for %s"),entry->d_name); add_sysfs_tunable(msg, filename,"min_power");
Signature · 1 line
1.8.5.rc3.362.gdf10213.dirty
Sergey Senozhatsky
PATCH 2/2 tuningsysfs: use lib process_directory() helper
In reply to Sergey Senozhatskyuse process_directory() helper while processing sata tunables.
--- src/tuning/tuningsysfs.cpp | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-)
src/tuning/tuningsysfs.cpp +8 -25
@@ -113,34 +113,17 @@ void add_sysfs_tunable(const char *str, const char *_sysfs_path, const char *_ta all_tunables.push_back(tunable); } -void add_sata_tunables(void) +static void add_sata_tunables_callback(const char *d_name) { - struct dirent *entry; - DIR *dir; char filename[4096]; char msg[4096]; - dir = opendir("/sys/class/scsi_host"); - - if (!dir) - return; - - while (1) { - entry = readdir(dir); - - if (!entry) - break; - - if (entry->d_name[0] == '.') - continue; - - sprintf(filename, "/sys/class/scsi_host/%s/link_power_management_policy", entry->d_name); - - sprintf(msg, _("Enable SATA link power management for %s"),entry->d_name); - - add_sysfs_tunable(msg, filename,"min_power"); - - } + sprintf(filename, "/sys/class/scsi_host/%s/link_power_management_policy", d_name); + sprintf(msg, _("Enable SATA link power management for %s"), d_name); + add_sysfs_tunable(msg, filename,"min_power"); +} - closedir(dir); +void add_sata_tunables(void) +{ + process_directory("/sys/class/scsi_host", add_sata_tunables_callback); }
Signature · 1 line
1.8.5.rc3.362.gdf10213.dirty
Alexandra Yates
Quoted 19 lines
Hello,
two small patches in -next.tuningsysfs:
- fix tuningsysfs typo
- useprocess_directory()helper functionplease pull from:
https://github.com/sergey-senozhatsky/powertop2-next.gitSergey Senozhatsky (2):
tuningsysfs: fix msg typo
tuningsysfs: use libprocess_directory()helpersrc/tuning/tuningsysfs.cpp | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-)
Quoted 8 lines
--
1.8.5.rc3.362.gdf10213.dirty_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop
Sergey
Your patches were merged today.
Thank you,
Alexandra.