Skip to content

Commit 2ed0b75

Browse files
Li Hengmartinetd
authored andcommitted
9p: Remove unneeded cast from memory allocation
Remove kmem_cache_alloc return value cast. Coccinelle emits the following warning: ./fs/9p/vfs_inode.c:226:12-29: WARNING: casting value returned by memory allocation function to (struct v9fs_inode *) is useless. Link: http://lkml.kernel.org/r/1596013140-49744-1-git-send-email-liheng40@huawei.com Signed-off-by: Li Heng <liheng40@huawei.com> [Dominique: commit message wording] Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
1 parent aab6c87 commit 2ed0b75

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/9p/vfs_inode.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,7 @@ v9fs_blank_wstat(struct p9_wstat *wstat)
223223
struct inode *v9fs_alloc_inode(struct super_block *sb)
224224
{
225225
struct v9fs_inode *v9inode;
226-
v9inode = (struct v9fs_inode *)kmem_cache_alloc(v9fs_inode_cache,
227-
GFP_KERNEL);
226+
v9inode = kmem_cache_alloc(v9fs_inode_cache, GFP_KERNEL);
228227
if (!v9inode)
229228
return NULL;
230229
#ifdef CONFIG_9P_FSCACHE

0 commit comments

Comments
 (0)