[src] cvs commit: src/sys/ufs/ufs ufs_gjournal.c

Bruce Evans brde at optusnet.com.au
Tue Apr 8 08:42:43 UTC 2008


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


More information about the freebsd-arch mailing list