mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs: udf: Optimize udf_free_in_core_inode and udf_find_fileset function
@ 2022-10-12 10:42 Li zeming
  2022-10-12 15:32 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Li zeming @ 2022-10-12 10:42 UTC (permalink / raw)
  To: jack; +Cc: linux-kernel, Li zeming

These two functions perform the following optimizations.
1. Delete the type cast of foo pointer. Void * does not need to convert
the type.
2. Delete the initialization assignment of bh variable, which is
assigned first.

Signed-off-by: Li zeming <zeming@nfschina.com>
---
 fs/udf/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/udf/super.c b/fs/udf/super.c
index 4042d9739fb7..06eda8177b5f 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -162,7 +162,7 @@ static void udf_free_in_core_inode(struct inode *inode)
 
 static void init_once(void *foo)
 {
-	struct udf_inode_info *ei = (struct udf_inode_info *)foo;
+	struct udf_inode_info *ei = foo;
 
 	ei->i_data = NULL;
 	inode_init_once(&ei->vfs_inode);
@@ -820,7 +820,7 @@ static int udf_find_fileset(struct super_block *sb,
 			    struct kernel_lb_addr *fileset,
 			    struct kernel_lb_addr *root)
 {
-	struct buffer_head *bh = NULL;
+	struct buffer_head *bh;
 	uint16_t ident;
 	int ret;
 
-- 
2.18.2


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

* Re: [PATCH] fs: udf: Optimize udf_free_in_core_inode and udf_find_fileset function
  2022-10-12 10:42 [PATCH] fs: udf: Optimize udf_free_in_core_inode and udf_find_fileset function Li zeming
@ 2022-10-12 15:32 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2022-10-12 15:32 UTC (permalink / raw)
  To: Li zeming; +Cc: jack, linux-kernel

On Wed 12-10-22 18:42:35, Li zeming wrote:
> These two functions perform the following optimizations.
> 1. Delete the type cast of foo pointer. Void * does not need to convert
> the type.
> 2. Delete the initialization assignment of bh variable, which is
> assigned first.
> 
> Signed-off-by: Li zeming <zeming@nfschina.com>

Thanks for the patch. It looks good, I'll queue it into my tree once the
merge window closes.

								Honza

> ---
>  fs/udf/super.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index 4042d9739fb7..06eda8177b5f 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -162,7 +162,7 @@ static void udf_free_in_core_inode(struct inode *inode)
>  
>  static void init_once(void *foo)
>  {
> -	struct udf_inode_info *ei = (struct udf_inode_info *)foo;
> +	struct udf_inode_info *ei = foo;
>  
>  	ei->i_data = NULL;
>  	inode_init_once(&ei->vfs_inode);
> @@ -820,7 +820,7 @@ static int udf_find_fileset(struct super_block *sb,
>  			    struct kernel_lb_addr *fileset,
>  			    struct kernel_lb_addr *root)
>  {
> -	struct buffer_head *bh = NULL;
> +	struct buffer_head *bh;
>  	uint16_t ident;
>  	int ret;
>  
> -- 
> 2.18.2
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

end of thread, other threads:[~2022-10-12 15:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-12 10:42 [PATCH] fs: udf: Optimize udf_free_in_core_inode and udf_find_fileset function Li zeming
2022-10-12 15:32 ` Jan Kara

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®