public inbox for ntfs3@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] fs/ntfs3/indx: Remove unnecessary 'NULL' values from Pointer
@ 2022-07-04 10:31 Li kunyu
  2022-07-06 16:10 ` Konstantin Komarov
  0 siblings, 1 reply; 2+ messages in thread
From: Li kunyu @ 2022-07-04 10:31 UTC (permalink / raw)
  To: almaz.alexandrovich; +Cc: ntfs3, linux-kernel, Li kunyu

Pointer variables allocate memory first, and then judge. There is no
need to initialize the assignment.

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

diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
index 6f81e3a49abf..b5c92b6ce01c 100644
--- a/fs/ntfs3/index.c
+++ b/fs/ntfs3/index.c
@@ -1685,8 +1685,8 @@ indx_insert_into_buffer(struct ntfs_index *indx, struct ntfs_inode *ni,
 {
 	int err;
 	const struct NTFS_DE *sp;
-	struct NTFS_DE *e, *de_t, *up_e = NULL;
-	struct indx_node *n2 = NULL;
+	struct NTFS_DE *e, *de_t, *up_e;
+	struct indx_node *n2;
 	struct indx_node *n1 = fnd->nodes[level];
 	struct INDEX_HDR *hdr1 = &n1->index->ihdr;
 	struct INDEX_HDR *hdr2;
-- 
2.18.2


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

* Re: [PATCH] fs/ntfs3/indx: Remove unnecessary 'NULL' values from Pointer
  2022-07-04 10:31 [PATCH] fs/ntfs3/indx: Remove unnecessary 'NULL' values from Pointer Li kunyu
@ 2022-07-06 16:10 ` Konstantin Komarov
  0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Komarov @ 2022-07-06 16:10 UTC (permalink / raw)
  To: Li kunyu; +Cc: ntfs3, linux-kernel

On 7/4/22 13:31, Li kunyu wrote:
> Pointer variables allocate memory first, and then judge. There is no
> need to initialize the assignment.
> 
> Signed-off-by: Li kunyu <kunyu@nfschina.com>
> ---
>   fs/ntfs3/index.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
> index 6f81e3a49abf..b5c92b6ce01c 100644
> --- a/fs/ntfs3/index.c
> +++ b/fs/ntfs3/index.c
> @@ -1685,8 +1685,8 @@ indx_insert_into_buffer(struct ntfs_index *indx, struct ntfs_inode *ni,
>   {
>   	int err;
>   	const struct NTFS_DE *sp;
> -	struct NTFS_DE *e, *de_t, *up_e = NULL;
> -	struct indx_node *n2 = NULL;
> +	struct NTFS_DE *e, *de_t, *up_e;
> +	struct indx_node *n2;
>   	struct indx_node *n1 = fnd->nodes[level];
>   	struct INDEX_HDR *hdr1 = &n1->index->ihdr;
>   	struct INDEX_HDR *hdr2;

Thanks for patch, applied!

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

end of thread, other threads:[~2022-07-06 16:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-04 10:31 [PATCH] fs/ntfs3/indx: Remove unnecessary 'NULL' values from Pointer Li kunyu
2022-07-06 16:10 ` Konstantin Komarov

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