From: Guenter Roeck <linux@roeck-us.net>
To: Pavel Machek <pavel@ucw.cz>
Cc: rjw@rjwysocki.net, lenb@kernel.org, robert.moore@intel.com,
lv.zheng@intel.com, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, devel@acpica.org
Subject: Re: [PATCH v2] acpi: Use kstrtoul() instead of strtoul()/simple_strtoul()
Date: Sun, 02 Aug 2015 01:19:19 -0700 [thread overview]
Message-ID: <55BDD287.70004@roeck-us.net> (raw)
In-Reply-To: <20150802071643.GF32270@amd>
On 08/02/2015 12:16 AM, Pavel Machek wrote:
> On Mon 2015-07-27 17:32:22, Guenter Roeck wrote:
>> simple_strtoul() is deprecated; replace with kstrtoul() and kstrtouint().
>> Return an error if the value passed to the sysfs attribute is not
>> a number.
>>
>> Drop the definition of strtoul() since it is no longer needed.
>>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>> ---
>> v2: An additional use of strtoul() was introduced with commit 4fa4616e.
>> Replace it as well.
>>
>> drivers/acpi/acpica/evgpeinit.c | 5 +++--
>> drivers/acpi/sysfs.c | 8 ++++++--
>> include/acpi/platform/aclinux.h | 1 -
>> 3 files changed, 9 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
>> index ea4c0d3fca2d..aa1e8c1f2d4a 100644
>> --- a/drivers/acpi/acpica/evgpeinit.c
>> +++ b/drivers/acpi/acpica/evgpeinit.c
>> @@ -326,6 +326,7 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,
>> u32 gpe_number;
>> char name[ACPI_NAME_SIZE + 1];
>> u8 type;
>> + int err;
>>
>> ACPI_FUNCTION_TRACE(ev_match_gpe_method);
>>
>> @@ -377,8 +378,8 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,
>>
>> /* 4) The last two characters of the name are the hex GPE Number */
>>
>> - gpe_number = strtoul(&name[2], NULL, 16);
>> - if (gpe_number == ACPI_UINT32_MAX) {
>> + er = kstrtouint(&name[2], 16, &gpe_number);
>> + if (err < 0 || gpe_number == ACPI_UINT32_MAX) {
>
> Are you sure you compile-tested this?
>
I was, but maybe not ;-). Since the patch was rejected it does not really matter.
Guenter
next prev parent reply other threads:[~2015-08-02 8:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 0:32 [PATCH v2] acpi: Use kstrtoul() instead of strtoul()/simple_strtoul() Guenter Roeck
2015-07-29 17:51 ` Moore, Robert
2015-07-29 18:38 ` Guenter Roeck
2015-07-29 19:33 ` Moore, Robert
2015-07-29 19:58 ` Guenter Roeck
2015-07-29 20:04 ` Rafael J. Wysocki
2015-07-29 20:37 ` Guenter Roeck
2015-07-29 19:57 ` Rafael J. Wysocki
2015-08-02 7:16 ` Pavel Machek
2015-08-02 8:19 ` Guenter Roeck [this message]
2015-11-06 16:21 ` Moore, Robert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55BDD287.70004@roeck-us.net \
--to=linux@roeck-us.net \
--cc=devel@acpica.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
--cc=robert.moore@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox