mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs/9p:  Remove cast from memory allocation
@ 2017-02-22  6:34 Tobin C. Harding
  2017-02-22  8:08 ` [V9fs-developer] " Greg Kurz
  0 siblings, 1 reply; 2+ messages in thread
From: Tobin C. Harding @ 2017-02-22  6:34 UTC (permalink / raw)
  To: Eric Van Hensbergen, Ron Minnich, Latchesar Ionkov
  Cc: v9fs-developer, kernel-janitors, linux-kernel, Tobin C. Harding

Coccinelle emits WARNING: casting value returned by memory allocation
function to (struct v9fs_inode *) is useless.

Remove unnecessary cast.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 fs/9p/vfs_inode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index f4f4450..462e9e4 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -238,8 +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,
-							GFP_KERNEL);
+	v9inode = kmem_cache_alloc(v9fs_inode_cache, GFP_KERNEL);
 	if (!v9inode)
 		return NULL;
 #ifdef CONFIG_9P_FSCACHE
-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [V9fs-developer] [PATCH] fs/9p: Remove cast from memory allocation
  2017-02-22  6:34 [PATCH] fs/9p: Remove cast from memory allocation Tobin C. Harding
@ 2017-02-22  8:08 ` Greg Kurz
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kurz @ 2017-02-22  8:08 UTC (permalink / raw)
  To: Tobin C. Harding
  Cc: Eric Van Hensbergen, Ron Minnich, Latchesar Ionkov,
	v9fs-developer, kernel-janitors, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 953 bytes --]

On Wed, 22 Feb 2017 17:34:13 +1100
"Tobin C. Harding" <me@tobin.cc> wrote:

> Coccinelle emits WARNING: casting value returned by memory allocation
> function to (struct v9fs_inode *) is useless.
> 
> Remove unnecessary cast.
> 
> Signed-off-by: Tobin C. Harding <me@tobin.cc>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  fs/9p/vfs_inode.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
> index f4f4450..462e9e4 100644
> --- a/fs/9p/vfs_inode.c
> +++ b/fs/9p/vfs_inode.c
> @@ -238,8 +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,
> -							GFP_KERNEL);
> +	v9inode = kmem_cache_alloc(v9fs_inode_cache, GFP_KERNEL);
>  	if (!v9inode)
>  		return NULL;
>  #ifdef CONFIG_9P_FSCACHE


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-22  9:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-22  6:34 [PATCH] fs/9p: Remove cast from memory allocation Tobin C. Harding
2017-02-22  8:08 ` [V9fs-developer] " Greg Kurz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®