lkml.org 
[lkml]   [2011]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: linux-next: manual merge of the cleancache tree with Linus' tree
On Thu, 24 Mar 2011 14:58:06 +0900 Minchan Kim <minchan.kim@gmail.com> wrote:

> Dan, one more thing.
>
> #define cleancache_fs_enabled_mapping(_mapping) \
> (mapping->host->i_sb->cleancache_poolid >= 0)
>
> One is "_mapping", another is "mapping"

It should be implemented in C too. This is the case for almost all
"functions" which are implemented as macros and it's rather a mystery
why we keep on typing #define!

It is not only for cleanliness and for typechecking, but also because
constructs such as

{
struct address_space *foo = ...;
if (cleancache_fs_enabled_mapping(foo))
...;
}

will generate an unused-var warning against `foo' if CONFIG_CLEANCACHE=n.
Implementing the function in C fixes that. With current gcc, anyway.


\
 
 \ /
  Last update: 2011-03-24 07:49    [W:0.264 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site