RE: [RESEND] [PATCH 3/6] ACPI: create sysfs I/F for inactive tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zhang Rui wrote:

> +		if (strncmp(table_attr->name, "NULL", ACPI_NAME_SIZE))
> +			memcpy(name, table_attr->name, ACPI_NAME_SIZE);
> +		else
> +			memcpy(name, "\0\0\0\0", ACPI_NAME_SIZE);
> +		status = acpi_get_table(name,
> +					table_attr->instance, &table_header);

Minor nit / suggestion: Wouldn't it be a bit better to use memset instead of memcpy for the \0\0\0\0 memcpy case?  Otherwise, you need to make sure that you have at least as many \0's in the string literal as ACPI_NAME_SIZE, which is a lil bit ugly.  If you are cleaning things up to use symbolic constants there, you might consider changing it to a memset while you're at it.

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

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux