From patchwork Mon Dec 4 10:45:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 13478167 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ilk+c3Cm" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 385B0C3 for ; Mon, 4 Dec 2023 02:44:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701686679; x=1733222679; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Kby4GQabOCo2+3jOwcDprLpYfk4E0SQYQ/P/kJyI3qA=; b=Ilk+c3CmOg5xx7RXhhWdJfnxQxiw3pXk1X/j6RA4a0upTpNrIvseHKA6 YcLGEEw858W5co0a88FfhyXVu4tmMX9q86YnX5XiGlKGucbO5v1M9MCnq Msek9ck4MQ1C3JvU6sRhw5HniwXmRcgbhTH/k3exf6BIOs8SADcaJlYnO Xf1F4MmQm+X/xdV/jex2sfGNc98cHSykku2ElAHEgpfvJkleXdDY+SWwn z+iWuK2pGjGALRpB3eDCe8GtD115hMA5k+KLmrzyvrfs1q/iM0vPMAVGH 10cQ1oQ7tYMEzRQYDjWImGqir33s/YcLUzYlTP8B3/tgc3XVGyxQ4I8bt Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="15260651" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="15260651" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 02:44:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="861338857" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="861338857" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by FMSMGA003.fm.intel.com with ESMTP; 04 Dec 2023 02:44:24 -0800 From: Mathias Nyman To: Cc: , Andy Shevchenko , Mathias Nyman Subject: [PATCH v2 02/18] xhci: dbc: Convert to use sysfs_streq() Date: Mon, 4 Dec 2023 12:45:18 +0200 Message-Id: <20231204104534.1335903-3-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231204104534.1335903-1-mathias.nyman@linux.intel.com> References: <20231204104534.1335903-1-mathias.nyman@linux.intel.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Andy Shevchenko It's standard approach to parse values from user space by using sysfs_streq(). Make driver use it. Signed-off-by: Andy Shevchenko Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-dbgcap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index 9e9ce3711813..f505b79afe53 100644 --- a/drivers/usb/host/xhci-dbgcap.c +++ b/drivers/usb/host/xhci-dbgcap.c @@ -957,9 +957,9 @@ static ssize_t dbc_store(struct device *dev, xhci = hcd_to_xhci(dev_get_drvdata(dev)); dbc = xhci->dbc; - if (!strncmp(buf, "enable", 6)) + if (sysfs_streq(buf, "enable")) xhci_dbc_start(dbc); - else if (!strncmp(buf, "disable", 7)) + else if (sysfs_streq(buf, "disable")) xhci_dbc_stop(dbc); else return -EINVAL;