[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1343658373.15432.18.camel@zakaz.uk.xensource.com>
Date: Mon, 30 Jul 2012 15:26:13 +0100
From: Ian Campbell <ijc@...lion.org.uk>
To: Len Brown <lenb@...nel.org>
Cc: Alan Stern <stern@...land.harvard.edu>, linux-acpi@...r.kernel.org,
linux-pm@...ts.linux-foundation.org,
Pavel Vasilyev <pavel@...linux.ru>,
linux-kernel@...r.kernel.org, Len Brown <len.brown@...el.com>
Subject: Re: [PATCH] ACPI: replace strlen("string") with sizeof("string") -1
On Thu, 2012-07-26 at 21:39 -0400, Len Brown wrote:
> ...both give the number of chars in the string
> without the '\0', as strncmp() wants,
> but sizeof() is compile-time.
I thought gcc optimised strlen("string literal") into a compile time
constant too. It does in a little userspace test I just wrote, but I
didn't look at its behaviour with the kernel's strlen.
Ian.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists