From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933540AbbBDWtW (ORCPT ); Wed, 4 Feb 2015 17:49:22 -0500 Received: from smtprelay0146.hostedemail.com ([216.40.44.146]:57263 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754475AbbBDWtU (ORCPT ); Wed, 4 Feb 2015 17:49:20 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 40,2.5,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:1801:2194:2198:2199:2200:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:4362:4605:5007:6119:6261:7875:7903:7974:10011:10400:10848:10967:11026:11232:11473:11658:11914:12043:12295:12438:12517:12519:12740:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:1:0 X-HE-Tag: kite61_17122e1460125 X-Filterd-Recvd-Size: 4025 Message-ID: <1423090157.30454.1.camel@perches.com> Subject: Re: [PATCH] kernel.h: Remove ancient __FUNCTION__ hack From: Joe Perches To: Andrew Morton Cc: Rasmus Villemoes , Michal Nazarewicz , linux-kernel@vger.kernel.org Date: Wed, 04 Feb 2015 14:49:17 -0800 In-Reply-To: <20150204143515.8bd14a53fceae8f38b0b0e8d@linux-foundation.org> References: <1423043318-29910-1-git-send-email-linux@rasmusvillemoes.dk> <1423076787.16386.9.camel@perches.com> <87egq5wg5y.fsf@rasmusvillemoes.dk> <1423083786.16386.13.camel@perches.com> <87a90twd2w.fsf@rasmusvillemoes.dk> <1423087515.16386.15.camel@perches.com> <20150204143515.8bd14a53fceae8f38b0b0e8d@linux-foundation.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.7-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2015-02-04 at 14:35 -0800, Andrew Morton wrote: > On Wed, 04 Feb 2015 14:05:15 -0800 Joe Perches wrote: > > On Wed, 2015-02-04 at 23:01 +0100, Rasmus Villemoes wrote: > > > On Wed, Feb 04 2015, Joe Perches wrote: > > > > On Wed, 2015-02-04 at 21:55 +0100, Rasmus Villemoes wrote: > > > >> On Wed, Feb 04 2015, Joe Perches wrote: > > > >> > On Wed, 2015-02-04 at 10:48 +0100, Rasmus Villemoes wrote: > > > >> >> __FUNCTION__ hasn't been treated as a string literal since gcc 3.4, so > > > >> >> this only helps people who only test-compile using 3.3 > > > >> >> (compiler-gcc3.h barks at anything older than that). Besides, there > > > >> >> are almost no occurrences of __FUNCTION__ left in the tree. > > > >> > The remaining uses of __FUNCTION__ need converting first. > > > >> Why? __FUNCTION__ is recognized just fine by gcc as an alias for __func__. > > > > And icc and clang and ...? > > > clang yes, icc probably (from quick googling). > > Cool, but it does seem safer/more conservative to me to > > convert the last 3 uses before doing this. [] > arch/x86/kernel/hpet.c | 2 +- > arch/x86/kernel/rtc.c | 4 ++-- > arch/x86/platform/intel-mid/intel_mid_vrtc.c | 2 +- > drivers/acpi/acpica/utdebug.c | 4 ++-- > drivers/block/xen-blkfront.c | 2 +- > include/acpi/acoutput.h | 6 +++--- > 6 files changed, 10 insertions(+), 10 deletions(-) Thanks. I had submitted patches for all the actual code uses (but not the comments) awhile ago. trivia about macros vs c99 predefined identifiers below: > diff -puN include/acpi/acoutput.h~kernelh-remove-ancient-__function__-hack-fix include/acpi/acoutput.h [] > @@ -240,7 +240,7 @@ > /* > * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header, > * define it now. This is the case where there the compiler does not support > - * a __FUNCTION__ macro or equivalent. > + * a __func__ macro or equivalent. Do these still make sense? __func__ isn't a macro. > @@ -249,12 +249,12 @@ [] > - * and macros such as __FUNCTION__. > + * and macros such as __func__. [] > -/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ > +/* Compiler supports __func__ (or equivalent) -- Ignore this macro */ [] > diff -puN drivers/acpi/acpica/utdebug.c~kernelh-remove-ancient-__function__-hack-fix drivers/acpi/acpica/utdebug.c > @@ -111,8 +111,8 @@ void acpi_ut_track_stack_ptr(void) [] > - * This allows compiler macros such as __FUNCTION__ to be used > - * with no change to the debug output. > + * This allows compiler macros such as __func__ to be used with no > + * change to the debug output.