PCI/ASPM: Convert to use sysfs_match_string() helper
PATCH 1/1 PCI/ASPM: Convert to use sysfs_match_string() helper
The commit
4cec16861a40 ("PCI/ASPM: Convert to use match_string() helper")
didn't take into consideration small but crucial detail about scope of usage, i.e. sysfs interface provided to handle the ASPM policy. Due to this in most of the cases input string comes with a new line symbol.
Use sysfs_match_string() helper to take into account above.
--- drivers/pci/pcie/aspm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pcie/aspm.c +1 -1
@@ -1127,7 +1127,7 @@ static int pcie_aspm_set_policy(const char *val,if (aspm_disabled)return -EPERM ; - i =match_string (policy_str,ARRAY_SIZE (policy_str), val); + i =sysfs_match_string (policy_str, val);if (i <0 )return i;if (i == aspm_policy)
Signature · 1 line
2.18.0
Quoted 8 lines · Andy Shevchenko
The commit
4cec16861a40("PCI/ASPM: Convert to usematch_string()helper")didn't take into consideration small but crucial detail about scope of usage, i.e. sysfs interface provided to handle the ASPM policy. Due to this in most of the cases input string comes with a new line symbol.
Quoted 5 lines
Use
sysfs_match_string()helper to take into account above.Signed-off-by Andy Shevchenko <[email protected]>Reported-by Heiner Kallweit <[email protected]>Fixes 4cec16861a40 ("PCI/ASPM: Convert to use match_string() helper")
Folded into original patch on pci/aspm for v4.19, thanks!
Quoted 20 lines
--- drivers/pci/pcie/aspm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pci/pcie/aspm.c +1
-1@@ -1127,7 +1127,7 @@ static int pcie_aspm_set_policy(const char *val,if (aspm_disabled)return -EPERM ; - i =match_string (policy_str,ARRAY_SIZE (policy_str), val); + i =sysfs_match_string (policy_str, val);if (i <0 )return i;if (i == aspm_policy)Signature · 1 line
2.18.0