linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] mm/secretmem: remove redundant initiialization of pointer file
@ 2023-01-16 16:43 Colin Ian King
  2023-01-19  9:45 ` Mike Rapoport
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2023-01-16 16:43 UTC (permalink / raw)
  To: Andrew Morton, linux-mm; +Cc: kernel-janitors, linux-kernel

The pointer file is being initialized with a value that is never read, it
is being re-assigned later on. Clean up code by removing the redundant
initialization.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 mm/secretmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/secretmem.c b/mm/secretmem.c
index 04c3ac9448a1..be3fff86ba00 100644
--- a/mm/secretmem.c
+++ b/mm/secretmem.c
@@ -190,7 +190,7 @@ static struct vfsmount *secretmem_mnt;
 
 static struct file *secretmem_file_create(unsigned long flags)
 {
-	struct file *file = ERR_PTR(-ENOMEM);
+	struct file *file;
 	struct inode *inode;
 	const char *anon_name = "[secretmem]";
 	const struct qstr qname = QSTR_INIT(anon_name, strlen(anon_name));
-- 
2.30.2



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

* Re: [PATCH][next] mm/secretmem: remove redundant initiialization of pointer file
  2023-01-16 16:43 [PATCH][next] mm/secretmem: remove redundant initiialization of pointer file Colin Ian King
@ 2023-01-19  9:45 ` Mike Rapoport
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2023-01-19  9:45 UTC (permalink / raw)
  To: Colin Ian King; +Cc: Andrew Morton, linux-mm, kernel-janitors, linux-kernel

On Mon, Jan 16, 2023 at 04:43:32PM +0000, Colin Ian King wrote:
> The pointer file is being initialized with a value that is never read, it
> is being re-assigned later on. Clean up code by removing the redundant
> initialization.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org>

> ---
>  mm/secretmem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/secretmem.c b/mm/secretmem.c
> index 04c3ac9448a1..be3fff86ba00 100644
> --- a/mm/secretmem.c
> +++ b/mm/secretmem.c
> @@ -190,7 +190,7 @@ static struct vfsmount *secretmem_mnt;
>  
>  static struct file *secretmem_file_create(unsigned long flags)
>  {
> -	struct file *file = ERR_PTR(-ENOMEM);
> +	struct file *file;
>  	struct inode *inode;
>  	const char *anon_name = "[secretmem]";
>  	const struct qstr qname = QSTR_INIT(anon_name, strlen(anon_name));
> -- 
> 2.30.2
> 
> 

-- 
Sincerely yours,
Mike.


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

end of thread, other threads:[~2023-01-19  9:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-16 16:43 [PATCH][next] mm/secretmem: remove redundant initiialization of pointer file Colin Ian King
2023-01-19  9:45 ` Mike Rapoport

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).