Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1736402 > unrolled thread

[PATCH 2/4] fs: Cocci spatch "alloc_cast"

Started byThomas Meyer <thomas@m3y3r.de>
First post2017-09-21 08:50 +0200
Last post2017-09-21 08:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/4] fs: Cocci spatch "alloc_cast" Thomas Meyer <thomas@m3y3r.de> - 2017-09-21 08:50 +0200

#1736402 — [PATCH 2/4] fs: Cocci spatch "alloc_cast"

FromThomas Meyer <thomas@m3y3r.de>
Date2017-09-21 08:50 +0200
Subject[PATCH 2/4] fs: Cocci spatch "alloc_cast"
Message-ID<us3t7-5H4-3@gated-at.bofh.it>
Remove casting the values returned by memory allocation functions like
kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc."
Found by coccinelle spatch "api/alloc/alloc_cast.cocci"

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -238,7 +238,7 @@ v9fs_blank_wstat(struct p9_wstat *wstat)
 struct inode *v9fs_alloc_inode(struct super_block *sb)
 {
 	struct v9fs_inode *v9inode;
-	v9inode = (struct v9fs_inode *)kmem_cache_alloc(v9fs_inode_cache,
+	v9inode = kmem_cache_alloc(v9fs_inode_cache,
 							GFP_KERNEL);
 	if (!v9inode)
 		return NULL;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web