From: WANG Cong <xiyou.wangcong@gmail.com>
To: chexum@shadow.banki.hu
Cc: linux-fsdevel@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
viro@zeniv.linux.org.uk, akpm@linux-foundation.org
Subject: [Patch] fs/romfs/inode.c: trivial improvements
Date: Wed, 18 Jul 2007 16:35:17 +0800 [thread overview]
Message-ID: <20070718083517.GA6179@localhost.localdomain> (raw)
1. There's no lists in fs/romfs/inode.c, so using list_entry is
a bit confusing. Replace it with container_of.
2. It is unnecessary to cast the return value of kmem_cache_alloc,
since it returns a void* pointer.
This patch is against 2.6.22.1.
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
---
fs/romfs/inode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.6.22.1/fs/romfs/inode.c
===================================================================
--- linux-2.6.22.1.orig/fs/romfs/inode.c 2007-07-12 00:47:28.000000000 +0800
+++ linux-2.6.22.1/fs/romfs/inode.c 2007-07-18 16:08:56.000000000 +0800
@@ -92,7 +92,7 @@
static inline struct romfs_inode_info *ROMFS_I(struct inode *inode)
{
- return list_entry(inode, struct romfs_inode_info, vfs_inode);
+ return container_of(inode, struct romfs_inode_info, vfs_inode);
}
static __u32
@@ -555,7 +555,7 @@
static struct inode *romfs_alloc_inode(struct super_block *sb)
{
struct romfs_inode_info *ei;
- ei = (struct romfs_inode_info *)kmem_cache_alloc(romfs_inode_cachep, GFP_KERNEL);
+ ei = kmem_cache_alloc(romfs_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
return &ei->vfs_inode;
reply other threads:[~2007-07-18 8:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070718083517.GA6179@localhost.localdomain \
--to=xiyou.wangcong@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chexum@shadow.banki.hu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).