From patchwork Fri Aug 3 09:51:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 953161 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41hj4G1nbqz9ryn for ; Fri, 3 Aug 2018 19:51:42 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732364AbeHCLrM (ORCPT ); Fri, 3 Aug 2018 07:47:12 -0400 Received: from mga01.intel.com ([192.55.52.88]:2983 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732327AbeHCLrM (ORCPT ); Fri, 3 Aug 2018 07:47:12 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2018 02:51:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,438,1526367600"; d="scan'208";a="251417697" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 03 Aug 2018 02:51:38 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EA031F8; Fri, 3 Aug 2018 12:51:37 +0300 (EEST) From: Andy Shevchenko To: Heiner Kallweit , linux-pci@vger.kernel.org, Bjorn Helgaas Cc: Andy Shevchenko Subject: [PATCH v1] PCI/ASPM: Convert to use sysfs_match_string() helper Date: Fri, 3 Aug 2018 12:51:37 +0300 Message-Id: <20180803095137.52401-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.18.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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. Signed-off-by: Andy Shevchenko Reported-by: Heiner Kallweit Fixes: 4cec16861a40 ("PCI/ASPM: Convert to use match_string() helper") --- drivers/pci/pcie/aspm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 0e88b3ad065f..5326916715d2 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -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)