diff mbox

acpi: compare of array

Message ID 20121025145746.17558.59853.stgit@localhost.localdomain (mailing list archive)
State Rejected, archived
Headers show

Commit Message

Alan Cox Oct. 25, 2012, 2:57 p.m. UTC
From: Alan Cox <alan@linux.intel.com>

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

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/acpi/event.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Peter Wu Oct. 28, 2012, 3:44 p.m. UTC | #1
On Thursday 25 October 2012 15:57:50 Alan Cox wrote:
> From: Alan Cox <alan@linux.intel.com>
> 
> This serves no purpose as it's an array not a pointer
> 
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
> 
>  drivers/acpi/event.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
> index 1442737..f84df83 100644
> --- a/drivers/acpi/event.c
> +++ b/drivers/acpi/event.c
> @@ -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)?

>  					  event.bus_id ? event.
>  					  bus_id : "<unknown>", event.type,
>  					  event.data);

Regards,
Peter
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index 1442737..f84df83 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -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);