mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] fs: ramfs: Drop unused 'handle' filed from struct ramfs_inode
@ 2019-03-12  7:21 Andrey Smirnov
  2019-03-12  7:21 ` [PATCH 2/3] fs: ramfs: Drop unused 'chunks' conter Andrey Smirnov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrey Smirnov @ 2019-03-12  7:21 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

There are no users of this field in the code. Drop it.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 fs/ramfs.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/ramfs.c b/fs/ramfs.c
index 3046afef3..94ecb0597 100644
--- a/fs/ramfs.c
+++ b/fs/ramfs.c
@@ -43,8 +43,6 @@ struct ramfs_inode {
 	char *symlink;
 	ulong mode;
 
-	struct handle_d *handle;
-
 	ulong size;
 	struct ramfs_chunk *data;
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/3] fs: ramfs: Drop unused 'chunks' conter
  2019-03-12  7:21 [PATCH 1/3] fs: ramfs: Drop unused 'handle' filed from struct ramfs_inode Andrey Smirnov
@ 2019-03-12  7:21 ` Andrey Smirnov
  2019-03-12  7:21 ` [PATCH 3/3] fs: ramfs: Drop unnecessary check in ramfs_mknod() Andrey Smirnov
  2019-03-13  8:37 ` [PATCH 1/3] fs: ramfs: Drop unused 'handle' filed from struct ramfs_inode Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Andrey Smirnov @ 2019-03-12  7:21 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

This variable doesn't appear to be used anywhere in the code. Drop it.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 fs/ramfs.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/ramfs.c b/fs/ramfs.c
index 94ecb0597..eec7cfb5b 100644
--- a/fs/ramfs.c
+++ b/fs/ramfs.c
@@ -99,8 +99,6 @@ static struct inode *ramfs_get_inode(struct super_block *sb, const struct inode
 	return inode;
 }
 
-static int chunks = 0;
-
 static struct ramfs_chunk *ramfs_get_chunk(void)
 {
 	struct ramfs_chunk *data = malloc(sizeof(struct ramfs_chunk));
@@ -113,7 +111,6 @@ static struct ramfs_chunk *ramfs_get_chunk(void)
 		return NULL;
 	}
 	data->next = NULL;
-	chunks++;
 
 	return data;
 }
@@ -122,7 +119,6 @@ static void ramfs_put_chunk(struct ramfs_chunk *data)
 {
 	free(data->data);
 	free(data);
-	chunks--;
 }
 
 /* ---------------------------------------------------------------*/
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 3/3] fs: ramfs: Drop unnecessary check in ramfs_mknod()
  2019-03-12  7:21 [PATCH 1/3] fs: ramfs: Drop unused 'handle' filed from struct ramfs_inode Andrey Smirnov
  2019-03-12  7:21 ` [PATCH 2/3] fs: ramfs: Drop unused 'chunks' conter Andrey Smirnov
@ 2019-03-12  7:21 ` Andrey Smirnov
  2019-03-13  8:37 ` [PATCH 1/3] fs: ramfs: Drop unused 'handle' filed from struct ramfs_inode Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Andrey Smirnov @ 2019-03-12  7:21 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

There's already an early exit statement triggered by "inode" being
NULL. Drop an extra check that will always be true.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 fs/ramfs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/ramfs.c b/fs/ramfs.c
index eec7cfb5b..7e7dc7aca 100644
--- a/fs/ramfs.c
+++ b/fs/ramfs.c
@@ -131,10 +131,8 @@ ramfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode)
 	if (!inode)
 		return -ENOSPC;
 
-	if (inode) {
-		d_instantiate(dentry, inode);
-		dget(dentry);   /* Extra count - pin the dentry in core */
-	}
+	d_instantiate(dentry, inode);
+	dget(dentry);   /* Extra count - pin the dentry in core */
 
 	return 0;
 }
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/3] fs: ramfs: Drop unused 'handle' filed from struct ramfs_inode
  2019-03-12  7:21 [PATCH 1/3] fs: ramfs: Drop unused 'handle' filed from struct ramfs_inode Andrey Smirnov
  2019-03-12  7:21 ` [PATCH 2/3] fs: ramfs: Drop unused 'chunks' conter Andrey Smirnov
  2019-03-12  7:21 ` [PATCH 3/3] fs: ramfs: Drop unnecessary check in ramfs_mknod() Andrey Smirnov
@ 2019-03-13  8:37 ` Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2019-03-13  8:37 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: barebox

On Tue, Mar 12, 2019 at 12:21:48AM -0700, Andrey Smirnov wrote:
> There are no users of this field in the code. Drop it.
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
>  fs/ramfs.c | 2 --
>  1 file changed, 2 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/fs/ramfs.c b/fs/ramfs.c
> index 3046afef3..94ecb0597 100644
> --- a/fs/ramfs.c
> +++ b/fs/ramfs.c
> @@ -43,8 +43,6 @@ struct ramfs_inode {
>  	char *symlink;
>  	ulong mode;
>  
> -	struct handle_d *handle;
> -
>  	ulong size;
>  	struct ramfs_chunk *data;
>  
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2019-03-13  8:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12  7:21 [PATCH 1/3] fs: ramfs: Drop unused 'handle' filed from struct ramfs_inode Andrey Smirnov
2019-03-12  7:21 ` [PATCH 2/3] fs: ramfs: Drop unused 'chunks' conter Andrey Smirnov
2019-03-12  7:21 ` [PATCH 3/3] fs: ramfs: Drop unnecessary check in ramfs_mknod() Andrey Smirnov
2019-03-13  8:37 ` [PATCH 1/3] fs: ramfs: Drop unused 'handle' filed from struct ramfs_inode Sascha Hauer

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