public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 9p: remove unnecessary type castings
@ 2022-04-01  7:05 Yu Zhe
  2022-04-01 17:06 ` Christian Schoenebeck
  0 siblings, 1 reply; 2+ messages in thread
From: Yu Zhe @ 2022-04-01  7:05 UTC (permalink / raw)
  To: ericvh, lucho, asmadeus, linux_oss
  Cc: v9fs-developer, linux-kernel, kernel-janitors, liqiong, Yu Zhe

remove unnecessary void* type castings.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
---
 fs/9p/fid.c            | 2 +-
 fs/9p/v9fs.c           | 2 +-
 fs/9p/vfs_inode.c      | 4 ++--
 fs/9p/vfs_inode_dotl.c | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index 79df61fe0e59..c2b8d7fc9e53 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -53,7 +53,7 @@ static struct p9_fid *v9fs_fid_find_inode(struct inode *inode, kuid_t uid)
 	p9_debug(P9_DEBUG_VFS, " inode: %p\n", inode);
 
 	spin_lock(&inode->i_lock);
-	h = (struct hlist_head *)&inode->i_private;
+	h = &inode->i_private;
 	hlist_for_each_entry(fid, h, ilist) {
 		if (uid_eq(fid->uid, uid)) {
 			refcount_inc(&fid->count);
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index e28ddf763b3b..51ddc58a7029 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -622,7 +622,7 @@ static void v9fs_sysfs_cleanup(void)
 
 static void v9fs_inode_init_once(void *foo)
 {
-	struct v9fs_inode *v9inode = (struct v9fs_inode *)foo;
+	struct v9fs_inode *v9inode = foo;
 
 	memset(&v9inode->qid, 0, sizeof(v9inode->qid));
 	inode_init_once(&v9inode->vfs_inode);
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 55367ecb9442..f415fd7a1eaf 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -409,7 +409,7 @@ static int v9fs_test_inode(struct inode *inode, void *data)
 	int umode;
 	dev_t rdev;
 	struct v9fs_inode *v9inode = V9FS_I(inode);
-	struct p9_wstat *st = (struct p9_wstat *)data;
+	struct p9_wstat *st = data;
 	struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode);
 
 	umode = p9mode2unixmode(v9ses, st, &rdev);
@@ -438,7 +438,7 @@ static int v9fs_test_new_inode(struct inode *inode, void *data)
 static int v9fs_set_inode(struct inode *inode,  void *data)
 {
 	struct v9fs_inode *v9inode = V9FS_I(inode);
-	struct p9_wstat *st = (struct p9_wstat *)data;
+	struct p9_wstat *st = data;
 
 	memcpy(&v9inode->qid, &st->qid, sizeof(st->qid));
 	return 0;
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index d17502a738a9..b910fee62e25 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -57,7 +57,7 @@ static kgid_t v9fs_get_fsgid_for_create(struct inode *dir_inode)
 static int v9fs_test_inode_dotl(struct inode *inode, void *data)
 {
 	struct v9fs_inode *v9inode = V9FS_I(inode);
-	struct p9_stat_dotl *st = (struct p9_stat_dotl *)data;
+	struct p9_stat_dotl *st = data;
 
 	/* don't match inode of different type */
 	if (inode_wrong_type(inode, st->st_mode))
@@ -88,7 +88,7 @@ static int v9fs_test_new_inode_dotl(struct inode *inode, void *data)
 static int v9fs_set_inode_dotl(struct inode *inode,  void *data)
 {
 	struct v9fs_inode *v9inode = V9FS_I(inode);
-	struct p9_stat_dotl *st = (struct p9_stat_dotl *)data;
+	struct p9_stat_dotl *st = data;
 
 	memcpy(&v9inode->qid, &st->qid, sizeof(st->qid));
 	inode->i_generation = st->st_gen;
-- 
2.25.1


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

* Re: [PATCH] 9p: remove unnecessary type castings
  2022-04-01  7:05 [PATCH] 9p: remove unnecessary type castings Yu Zhe
@ 2022-04-01 17:06 ` Christian Schoenebeck
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Schoenebeck @ 2022-04-01 17:06 UTC (permalink / raw)
  To: Yu Zhe
  Cc: ericvh, lucho, asmadeus, v9fs-developer, linux-kernel,
	kernel-janitors, liqiong

On Freitag, 1. April 2022 09:05:45 CEST Yu Zhe wrote:
> remove unnecessary void* type castings.
> 
> Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
> ---

Reviewed-by: Christian Schoenebeck <linux_oss@crudebyte.com>

>  fs/9p/fid.c            | 2 +-
>  fs/9p/v9fs.c           | 2 +-
>  fs/9p/vfs_inode.c      | 4 ++--
>  fs/9p/vfs_inode_dotl.c | 4 ++--
>  4 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/9p/fid.c b/fs/9p/fid.c
> index 79df61fe0e59..c2b8d7fc9e53 100644
> --- a/fs/9p/fid.c
> +++ b/fs/9p/fid.c
> @@ -53,7 +53,7 @@ static struct p9_fid *v9fs_fid_find_inode(struct inode
> *inode, kuid_t uid) p9_debug(P9_DEBUG_VFS, " inode: %p\n", inode);
> 
>  	spin_lock(&inode->i_lock);
> -	h = (struct hlist_head *)&inode->i_private;
> +	h = &inode->i_private;
>  	hlist_for_each_entry(fid, h, ilist) {
>  		if (uid_eq(fid->uid, uid)) {
>  			refcount_inc(&fid->count);
> diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
> index e28ddf763b3b..51ddc58a7029 100644
> --- a/fs/9p/v9fs.c
> +++ b/fs/9p/v9fs.c
> @@ -622,7 +622,7 @@ static void v9fs_sysfs_cleanup(void)
> 
>  static void v9fs_inode_init_once(void *foo)
>  {
> -	struct v9fs_inode *v9inode = (struct v9fs_inode *)foo;
> +	struct v9fs_inode *v9inode = foo;
> 
>  	memset(&v9inode->qid, 0, sizeof(v9inode->qid));
>  	inode_init_once(&v9inode->vfs_inode);
> diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
> index 55367ecb9442..f415fd7a1eaf 100644
> --- a/fs/9p/vfs_inode.c
> +++ b/fs/9p/vfs_inode.c
> @@ -409,7 +409,7 @@ static int v9fs_test_inode(struct inode *inode, void
> *data) int umode;
>  	dev_t rdev;
>  	struct v9fs_inode *v9inode = V9FS_I(inode);
> -	struct p9_wstat *st = (struct p9_wstat *)data;
> +	struct p9_wstat *st = data;
>  	struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode);
> 
>  	umode = p9mode2unixmode(v9ses, st, &rdev);
> @@ -438,7 +438,7 @@ static int v9fs_test_new_inode(struct inode *inode, void
> *data) static int v9fs_set_inode(struct inode *inode,  void *data)
>  {
>  	struct v9fs_inode *v9inode = V9FS_I(inode);
> -	struct p9_wstat *st = (struct p9_wstat *)data;
> +	struct p9_wstat *st = data;
> 
>  	memcpy(&v9inode->qid, &st->qid, sizeof(st->qid));
>  	return 0;
> diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
> index d17502a738a9..b910fee62e25 100644
> --- a/fs/9p/vfs_inode_dotl.c
> +++ b/fs/9p/vfs_inode_dotl.c
> @@ -57,7 +57,7 @@ static kgid_t v9fs_get_fsgid_for_create(struct inode
> *dir_inode) static int v9fs_test_inode_dotl(struct inode *inode, void
> *data)
>  {
>  	struct v9fs_inode *v9inode = V9FS_I(inode);
> -	struct p9_stat_dotl *st = (struct p9_stat_dotl *)data;
> +	struct p9_stat_dotl *st = data;
> 
>  	/* don't match inode of different type */
>  	if (inode_wrong_type(inode, st->st_mode))
> @@ -88,7 +88,7 @@ static int v9fs_test_new_inode_dotl(struct inode *inode,
> void *data) static int v9fs_set_inode_dotl(struct inode *inode,  void
> *data)
>  {
>  	struct v9fs_inode *v9inode = V9FS_I(inode);
> -	struct p9_stat_dotl *st = (struct p9_stat_dotl *)data;
> +	struct p9_stat_dotl *st = data;
> 
>  	memcpy(&v9inode->qid, &st->qid, sizeof(st->qid));
>  	inode->i_generation = st->st_gen;



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

end of thread, other threads:[~2022-04-01 17:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-01  7:05 [PATCH] 9p: remove unnecessary type castings Yu Zhe
2022-04-01 17:06 ` Christian Schoenebeck

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