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]

 



On Thu, 2008-11-13 at 04:32 +0800, Skywing wrote:
> 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?
that works as well.

>  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.
> 
well, we have an ugly ACPI table here, with the signature "\0\0\0\0".
and the code memcpy(name, "\0\0\0\0", ACPI_NAME_SIZE) is used to set a
valid table signature rather than clearing this piece of memeory.
so IMO, using memcpy also makes sense here. :)

thanks,
rui

--
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