Skip to contentSkip to conversation

acpi: compare of array

PATCH In review Alan Cox 2 participants 2 messages Oct 25, 2012 – Oct 28, 2012 ACPI

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 acpi: compare of array

From: Alan Cox <[email protected]>

This serves no purpose as it's an array not a pointer

---

 drivers/acpi/event.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/acpi/event.c +1 -2
index 1442737..f84df83 100644
@@ -67,8 +67,7 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count,
 			return result;
 
 		chars_remaining = sprintf(str, "%s %s %08x %08x\n",
-					  event.device_class ? event.
-					  device_class : "<unknown>",
+					  event.device_class : "<unknown>",
 					  event.bus_id ? event.
 					  bus_id : "<unknown>", event.type,
 					  event.data);
#1 lore raw
Quoted 15 lines · On Thursday 25 October 2012 15:57:50 Alan Cox wrote:

From: Alan Cox <[email protected]>

This serves no purpose as it's an array not a pointer

---

 drivers/acpi/event.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/acpi/event.c +0 -0
index 1442737..f84df83 100644

drivers/acpi/event.c acpi_system_read_event(struct file *file, char __user * · line 70

Quoted 6 lines
drivers/acpi/event.c +1 -2
@@ -67,8 +67,7 @@ acpi_system_read_event(struct file *file, char __user *
 buffer, size_t count, return result;
 
 		chars_remaining = sprintf(str, "%s %s %08x %08x\n",
-					  event.device_class ? event.
-					  device_class : "<unknown>",
+					  event.device_class : "<unknown>",

: "<unknown>" should be removed too to avoid a compile error. If it is an array, is it not better to check event.device_class[0] != 0 (an empty string)?

drivers/acpi/event.c acpi_system_read_event(struct file *file, char __user * buffer, size_t count, · line 73

Quoted 3 lines
drivers/acpi/event.c +0 -0
 					  event.bus_id ? event.
 					  bus_id : "<unknown>", event.type,
 					  event.data);

Regards,
Peter