diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2007-10-17 02:26:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:47 -0400 |
commit | 55ca3e796d452d1fd213846ae6ce8bc4d37b54cc (patch) | |
tree | 427c69b9ca01c3c259fe71b1d84ee18abbf27979 /fs/romfs/inode.c | |
parent | 0cbc591bf884a5662b2fbb21b5c09fa1c1c7b579 (diff) |
fs/romfs/inode.c: trivial improvements
- There are no lists in fs/romfs/inode.c, so using list_entry
is a bit confusing. Replace it with container_of.
- It is unnecessary to cast the return value of
kmem_cache_alloc, since it returns a void* pointer.
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/romfs/inode.c')
-rw-r--r-- | fs/romfs/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c index 7c5e5f573b05..a49cf5b9a195 100644 --- a/fs/romfs/inode.c +++ b/fs/romfs/inode.c | |||
@@ -92,7 +92,7 @@ static inline unsigned long romfs_maxsize(struct super_block *sb) | |||
92 | 92 | ||
93 | static inline struct romfs_inode_info *ROMFS_I(struct inode *inode) | 93 | static inline struct romfs_inode_info *ROMFS_I(struct inode *inode) |
94 | { | 94 | { |
95 | return list_entry(inode, struct romfs_inode_info, vfs_inode); | 95 | return container_of(inode, struct romfs_inode_info, vfs_inode); |
96 | } | 96 | } |
97 | 97 | ||
98 | static __u32 | 98 | static __u32 |
@@ -555,7 +555,7 @@ static struct kmem_cache * romfs_inode_cachep; | |||
555 | static struct inode *romfs_alloc_inode(struct super_block *sb) | 555 | static struct inode *romfs_alloc_inode(struct super_block *sb) |
556 | { | 556 | { |
557 | struct romfs_inode_info *ei; | 557 | struct romfs_inode_info *ei; |
558 | ei = (struct romfs_inode_info *)kmem_cache_alloc(romfs_inode_cachep, GFP_KERNEL); | 558 | ei = kmem_cache_alloc(romfs_inode_cachep, GFP_KERNEL); |
559 | if (!ei) | 559 | if (!ei) |
560 | return NULL; | 560 | return NULL; |
561 | return &ei->vfs_inode; | 561 | return &ei->vfs_inode; |