public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: fix test for hex digit.
@ 2014-07-30 19:52 Arjun Sreedharan
  2014-07-30 20:00 ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Arjun Sreedharan @ 2014-07-30 19:52 UTC (permalink / raw)
  To: rjw; +Cc: lenb, linux-acpi, linux-kernel

decimal 0 is ascii for NULL. Hex digit matching should be from '0'
(decimal 30 of ascii) to '9' and 'A' to 'F'.
Unfixed version returns true for #,$,%,& etc.

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
---
 drivers/acpi/acpi_pnp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c
index 4ddb0dc..a4945a5 100644
--- a/drivers/acpi/acpi_pnp.c
+++ b/drivers/acpi/acpi_pnp.c
@@ -322,7 +322,7 @@ static const struct acpi_device_id acpi_pnp_device_ids[] = {
 
 static bool is_hex_digit(char c)
 {
-	return (c >= 0 && c <= '9') || (c >= 'A' && c <= 'F');
+	return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F');
 }
 
 static bool matching_id(char *idstr, char *list_id)
-- 
1.8.1.msysgit.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-07-31 22:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-30 19:52 [PATCH] ACPI: fix test for hex digit Arjun Sreedharan
2014-07-30 20:00 ` Joe Perches
2014-07-31  0:05   ` [PATCH] Replace faulty is_hex_digit() by isxdigit() Arjun Sreedharan
2014-07-31  0:10     ` Randy Dunlap
2014-07-31  9:04       ` Arjun Sreedharan
2014-07-31 16:31         ` Randy Dunlap
2014-07-31 22:31           ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox