From owner-freebsd-arch@FreeBSD.ORG Thu Apr 10 04:56:43 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCBB7106564A for ; Thu, 10 Apr 2008 04:56:43 +0000 (UTC) (envelope-from peter@wemm.org) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.243]) by mx1.freebsd.org (Postfix) with ESMTP id 908778FC29 for ; Thu, 10 Apr 2008 04:56:43 +0000 (UTC) (envelope-from peter@wemm.org) Received: by an-out-0708.google.com with SMTP id c14so766463anc.13 for ; Wed, 09 Apr 2008 21:56:43 -0700 (PDT) Received: by 10.100.247.14 with SMTP id u14mr1148116anh.128.1207801927821; Wed, 09 Apr 2008 21:32:07 -0700 (PDT) Received: by 10.100.8.6 with HTTP; Wed, 9 Apr 2008 21:32:07 -0700 (PDT) Message-ID: Date: Wed, 9 Apr 2008 21:32:07 -0700 From: "Peter Wemm" To: "Bruce Evans" In-Reply-To: <20080408142942.B18072@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080407181250.6733810656C9@hub.freebsd.org> <47FA6833.8080904@delphij.net> <20080408142942.B18072@delplex.bde.org> Cc: delphij@freebsd.org, d@delphij.net, freebsd-arch@freebsd.org Subject: Re: [src] cvs commit: src/sys/ufs/ufs ufs_gjournal.c X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2008 04:56:43 -0000 On Mon, Apr 7, 2008 at 9:51 PM, Bruce Evans wrote: > On Mon, 7 Apr 2008, LI Xin wrote: > > > > Picking a random commit: > > > > > > > > > > FreeBSD src repository > > > > > > Modified files: > > > sys/ufs/ufs ufs_gjournal.c Log: > > > Correct function name in panic(). > > > Reported by: kensmith > > > Revision Changes Path > > > 1.3 +1 -1 src/sys/ufs/ufs/ufs_gjournal.c > > > > > > if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg) > > > - panic("ffs_freefile: range: dev = %s, ino = %lu, fs = > %s", > > > + panic("ufs_gjournal_modref: range: dev = %s, ino = %lu, > fs = %s", > > > devtoname(dev), (u_long)ino, fs->fs_fsmnt); > > > if ((error = bread(devvp, cgbno, (int)fs->fs_cgsize, NOCRED, > &bp))) { > > > brelse(bp); > > > > > > > > > Is it suitable to use something like __func__ here? I mean, will the > usage of __func__ encouraged practice for base/kernel code or not? > > > > No, __func__ is an obfuscation. It is sort of write-only. It should > only be used when the function name is not a compile-time constant > (mainly in macros). Its use would be an especially large style bug > in ufs, since ufs consistently doesn't use it (except in 1 recently > broken place). > > The above commit also breaks the style using blind substitution which > happens to expand a line beyond 80 characters. > > Bruce I tend to agree. My own personal reason is that I tend to frequently grep the source for printf and panic strings. grep can't do __func__ substitution. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell **WANTED TO BUY: Garmin Streetpilot 2650 or 2660. Not later model! **