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


Groups > linux.kernel > #1439831 > unrolled thread

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

Started byMarkus Mayer <mmayer@broadcom.com>
First post2016-07-09 00:50 +0200
Last post2016-07-09 01:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3 3/7] ACPI / device_sysfs: make use of new strtolower() function Markus Mayer <mmayer@broadcom.com> - 2016-07-09 00:50 +0200
    Re: [PATCH v3 3/7] ACPI / device_sysfs: make use of new strtolower() function "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-07-09 01:20 +0200

#1439831 — [PATCH v3 3/7] ACPI / device_sysfs: make use of new strtolower() function

FromMarkus Mayer <mmayer@broadcom.com>
Date2016-07-09 00:50 +0200
Subject[PATCH v3 3/7] ACPI / device_sysfs: make use of new strtolower() function
Message-ID<rSMKR-2Eu-5@gated-at.bofh.it>
Call strtolower() rather than walking the string explicitly to convert
it to lowercase.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---

Rafael, I left off your ACK, since the implementation of my function
changed somewhat (doesn't check the argument NULL, doesn't return
anything). Please let me know if you are still okay with this.

 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

[toc] | [next] | [standalone]


#1439845

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2016-07-09 01:20 +0200
Message-ID<rSNdT-34O-7@gated-at.bofh.it>
In reply to#1439831
On Friday, July 08, 2016 03:43:10 PM Markus Mayer wrote:
> Call strtolower() rather than walking the string explicitly to convert
> it to lowercase.
> 
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
> 
> Rafael, I left off your ACK, since the implementation of my function
> changed somewhat (doesn't check the argument NULL, doesn't return
> anything). Please let me know if you are still okay with this.

I am, as long as it doesn't change the result, which seems to be the case.

>  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);
> 

Thanks,
Rafael

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web