Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1448835

[PATCH v4 3/7] ACPI / device_sysfs: make use of new strtolower() function

From Markus Mayer <mmayer@broadcom.com>
Newsgroups linux.kernel
Subject [PATCH v4 3/7] ACPI / device_sysfs: make use of new strtolower() function
Date 2016-07-23 01:40 +0200
Message-ID <rXScV-3Uh-27@gated-at.bofh.it> (permalink)
References <rXScV-3Uh-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Call strtolower() rather than walking the string explicitly to convert
it to lowercase.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
Acked-by: Rafael J. Wysocki <rjw@rjwysocki.net>
---
 drivers/acpi/device_sysfs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c
index 7b2c48f..1db38c7 100644
--- a/drivers/acpi/device_sysfs.c
+++ b/drivers/acpi/device_sysfs.c
@@ -200,12 +200,10 @@ static int create_of_modalias(struct acpi_device *acpi_dev, char *modalias,
 	const union acpi_object *of_compatible, *obj;
 	int len, count;
 	int i, nval;
-	char *c;
 
 	acpi_get_name(acpi_dev->handle, ACPI_SINGLE_NAME, &buf);
 	/* DT strings are all in lower case */
-	for (c = buf.pointer; *c != '\0'; c++)
-		*c = tolower(*c);
+	strtolower(buf.pointer);
 
 	len = snprintf(modalias, size, "of:N%sT", (char *)buf.pointer);
 	ACPI_FREE(buf.pointer);
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/7] lib: string: add functions to case-convert strings Markus Mayer <mmayer@broadcom.com> - 2016-07-23 01:40 +0200
  [PATCH v4 4/7] staging: speakup: replace spk_strlwr() with strlcpytolower() Markus Mayer <mmayer@broadcom.com> - 2016-07-23 01:40 +0200
    Re: [PATCH v4 4/7] staging: speakup: replace spk_strlwr() with strlcpytolower() Chris Brannon <chris@the-brannons.com> - 2016-07-23 02:10 +0200
  [PATCH v4 1/7] lib: string: add functions to case-convert strings Markus Mayer <mmayer@broadcom.com> - 2016-07-23 01:40 +0200
  [PATCH v4 3/7] ACPI / device_sysfs: make use of new strtolower() function Markus Mayer <mmayer@broadcom.com> - 2016-07-23 01:40 +0200
  [PATCH v4 5/7] iscsi-target: replace iscsi_initiatorname_tolower() with strtolower() Markus Mayer <mmayer@broadcom.com> - 2016-07-23 01:40 +0200
  [PATCH v4 2/7] drm/nouveau/core: make use of new strlcpytolower() function Markus Mayer <mmayer@broadcom.com> - 2016-07-23 01:40 +0200

csiph-web