All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: deleted "set but not used" variables
@ 2013-07-08  5:23 jon ernst
  2013-07-08 23:37 ` Zheng Liu
  2014-01-11 18:27 ` Theodore Ts'o
  0 siblings, 2 replies; 4+ messages in thread
From: jon ernst @ 2013-07-08  5:23 UTC (permalink / raw)
  To: linux-ext4

to delete "set but not used" variables

Signed-off-by: Jon Ernst <jonernst07@gmail.com>
---

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 7097b0f..df0e9b2 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4391,7 +4391,6 @@ void ext4_ext_truncate(handle_t *handle, struct
inode *inode)
 {
        struct super_block *sb = inode->i_sb;
        ext4_lblk_t last_block;
-       int err = 0;

        /*
         * TODO: optimization is possible here.
@@ -4405,9 +4404,9 @@ void ext4_ext_truncate(handle_t *handle, struct
inode *inode)

        last_block = (inode->i_size + sb->s_blocksize - 1)
                        >> EXT4_BLOCK_SIZE_BITS(sb);
-       err = ext4_es_remove_extent(inode, last_block,
-                                   EXT_MAX_BLOCKS - last_block);
-       err = ext4_ext_remove_space(inode, last_block, EXT_MAX_BLOCKS - 1);
+       ext4_es_remove_extent(inode, last_block,
+                       EXT_MAX_BLOCKS - last_block);
+       ext4_ext_remove_space(inode, last_block, EXT_MAX_BLOCKS - 1);
 }

 static void ext4_falloc_update_inode(struct inode *inode,
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index b8a0746..35f43e9 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -994,11 +994,9 @@ static int ext4_add_dirent_to_inline(handle_t *handle,
        struct inode    *dir = dentry->d_parent->d_inode;
        const char      *name = dentry->d_name.name;
        int             namelen = dentry->d_name.len;
-       unsigned short  reclen;
        int             err;
        struct ext4_dir_entry_2 *de;

-       reclen = EXT4_DIR_REC_LEN(namelen);
        err = ext4_find_dest_de(dir, inode, iloc->bh,
                                inline_start, inline_size,
                                name, namelen, &de);
@@ -1870,7 +1868,6 @@ int ext4_try_to_evict_inline_data(handle_t *handle,
 {
        int error;
        struct ext4_xattr_entry *entry;
-       struct ext4_xattr_ibody_header *header;
        struct ext4_inode *raw_inode;
        struct ext4_iloc iloc;

@@ -1879,7 +1876,6 @@ int ext4_try_to_evict_inline_data(handle_t *handle,
                return error;

        raw_inode = ext4_raw_inode(&iloc);
-       header = IHDR(inode, raw_inode);
        entry = (struct ext4_xattr_entry *)((void *)raw_inode +
                                            EXT4_I(inode)->i_inline_off);
        if (EXT4_XATTR_LEN(entry->e_name_len) +
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 9491ac0..38b5169 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -100,7 +100,6 @@ static long swap_inode_boot_loader(struct super_block *sb,
        handle_t *handle;
        int err;
        struct inode *inode_bl;
-       struct ext4_inode_info *ei;
        struct ext4_inode_info *ei_bl;
        struct ext4_sb_info *sbi;

@@ -115,7 +114,6 @@ static long swap_inode_boot_loader(struct super_block *sb,
        }

        sbi = EXT4_SB(sb);
-       ei = EXT4_I(inode);

        inode_bl = ext4_iget(sb, EXT4_BOOT_LOADER_INO);
        if (IS_ERR(inode_bl)) {

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

* Re: [PATCH] ext4: deleted "set but not used" variables
  2013-07-08  5:23 [PATCH] ext4: deleted "set but not used" variables jon ernst
@ 2013-07-08 23:37 ` Zheng Liu
  2013-07-08 23:38   ` Zheng Liu
  2014-01-11 18:27 ` Theodore Ts'o
  1 sibling, 1 reply; 4+ messages in thread
From: Zheng Liu @ 2013-07-08 23:37 UTC (permalink / raw)
  To: jon ernst; +Cc: linux-ext4

On Mon, Jul 08, 2013 at 05:23:49AM +0000, jon ernst wrote:
> to delete "set but not used" variables
> 
> Signed-off-by: Jon Ernst <jonernst07@gmail.com>

The patch looks good to me.
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>

Regards,
                                                - Zheng
> ---
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 7097b0f..df0e9b2 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -4391,7 +4391,6 @@ void ext4_ext_truncate(handle_t *handle, struct
> inode *inode)
>  {
>         struct super_block *sb = inode->i_sb;
>         ext4_lblk_t last_block;
> -       int err = 0;
> 
>         /*
>          * TODO: optimization is possible here.
> @@ -4405,9 +4404,9 @@ void ext4_ext_truncate(handle_t *handle, struct
> inode *inode)
> 
>         last_block = (inode->i_size + sb->s_blocksize - 1)
>                         >> EXT4_BLOCK_SIZE_BITS(sb);
> -       err = ext4_es_remove_extent(inode, last_block,
> -                                   EXT_MAX_BLOCKS - last_block);
> -       err = ext4_ext_remove_space(inode, last_block, EXT_MAX_BLOCKS - 1);
> +       ext4_es_remove_extent(inode, last_block,
> +                       EXT_MAX_BLOCKS - last_block);
> +       ext4_ext_remove_space(inode, last_block, EXT_MAX_BLOCKS - 1);
>  }
> 
>  static void ext4_falloc_update_inode(struct inode *inode,
> diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
> index b8a0746..35f43e9 100644
> --- a/fs/ext4/inline.c
> +++ b/fs/ext4/inline.c
> @@ -994,11 +994,9 @@ static int ext4_add_dirent_to_inline(handle_t *handle,
>         struct inode    *dir = dentry->d_parent->d_inode;
>         const char      *name = dentry->d_name.name;
>         int             namelen = dentry->d_name.len;
> -       unsigned short  reclen;
>         int             err;
>         struct ext4_dir_entry_2 *de;
> 
> -       reclen = EXT4_DIR_REC_LEN(namelen);
>         err = ext4_find_dest_de(dir, inode, iloc->bh,
>                                 inline_start, inline_size,
>                                 name, namelen, &de);
> @@ -1870,7 +1868,6 @@ int ext4_try_to_evict_inline_data(handle_t *handle,
>  {
>         int error;
>         struct ext4_xattr_entry *entry;
> -       struct ext4_xattr_ibody_header *header;
>         struct ext4_inode *raw_inode;
>         struct ext4_iloc iloc;
> 
> @@ -1879,7 +1876,6 @@ int ext4_try_to_evict_inline_data(handle_t *handle,
>                 return error;
> 
>         raw_inode = ext4_raw_inode(&iloc);
> -       header = IHDR(inode, raw_inode);
>         entry = (struct ext4_xattr_entry *)((void *)raw_inode +
>                                             EXT4_I(inode)->i_inline_off);
>         if (EXT4_XATTR_LEN(entry->e_name_len) +
> diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> index 9491ac0..38b5169 100644
> --- a/fs/ext4/ioctl.c
> +++ b/fs/ext4/ioctl.c
> @@ -100,7 +100,6 @@ static long swap_inode_boot_loader(struct super_block *sb,
>         handle_t *handle;
>         int err;
>         struct inode *inode_bl;
> -       struct ext4_inode_info *ei;
>         struct ext4_inode_info *ei_bl;
>         struct ext4_sb_info *sbi;
> 
> @@ -115,7 +114,6 @@ static long swap_inode_boot_loader(struct super_block *sb,
>         }
> 
>         sbi = EXT4_SB(sb);
> -       ei = EXT4_I(inode);
> 
>         inode_bl = ext4_iget(sb, EXT4_BOOT_LOADER_INO);
>         if (IS_ERR(inode_bl)) {
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] ext4: deleted "set but not used" variables
  2013-07-08 23:37 ` Zheng Liu
@ 2013-07-08 23:38   ` Zheng Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Zheng Liu @ 2013-07-08 23:38 UTC (permalink / raw)
  To: jon ernst, linux-ext4

On Tue, Jul 09, 2013 at 07:37:24AM +0800, Zheng Liu wrote:
> On Mon, Jul 08, 2013 at 05:23:49AM +0000, jon ernst wrote:
> > to delete "set but not used" variables
> > 
> > Signed-off-by: Jon Ernst <jonernst07@gmail.com>
> 
> The patch looks good to me.
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>

Oops, sorry, it should be:
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>

                                                - Zheng

> 
> Regards,
>                                                 - Zheng
> > ---
> > 
> > diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> > index 7097b0f..df0e9b2 100644
> > --- a/fs/ext4/extents.c
> > +++ b/fs/ext4/extents.c
> > @@ -4391,7 +4391,6 @@ void ext4_ext_truncate(handle_t *handle, struct
> > inode *inode)
> >  {
> >         struct super_block *sb = inode->i_sb;
> >         ext4_lblk_t last_block;
> > -       int err = 0;
> > 
> >         /*
> >          * TODO: optimization is possible here.
> > @@ -4405,9 +4404,9 @@ void ext4_ext_truncate(handle_t *handle, struct
> > inode *inode)
> > 
> >         last_block = (inode->i_size + sb->s_blocksize - 1)
> >                         >> EXT4_BLOCK_SIZE_BITS(sb);
> > -       err = ext4_es_remove_extent(inode, last_block,
> > -                                   EXT_MAX_BLOCKS - last_block);
> > -       err = ext4_ext_remove_space(inode, last_block, EXT_MAX_BLOCKS - 1);
> > +       ext4_es_remove_extent(inode, last_block,
> > +                       EXT_MAX_BLOCKS - last_block);
> > +       ext4_ext_remove_space(inode, last_block, EXT_MAX_BLOCKS - 1);
> >  }
> > 
> >  static void ext4_falloc_update_inode(struct inode *inode,
> > diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
> > index b8a0746..35f43e9 100644
> > --- a/fs/ext4/inline.c
> > +++ b/fs/ext4/inline.c
> > @@ -994,11 +994,9 @@ static int ext4_add_dirent_to_inline(handle_t *handle,
> >         struct inode    *dir = dentry->d_parent->d_inode;
> >         const char      *name = dentry->d_name.name;
> >         int             namelen = dentry->d_name.len;
> > -       unsigned short  reclen;
> >         int             err;
> >         struct ext4_dir_entry_2 *de;
> > 
> > -       reclen = EXT4_DIR_REC_LEN(namelen);
> >         err = ext4_find_dest_de(dir, inode, iloc->bh,
> >                                 inline_start, inline_size,
> >                                 name, namelen, &de);
> > @@ -1870,7 +1868,6 @@ int ext4_try_to_evict_inline_data(handle_t *handle,
> >  {
> >         int error;
> >         struct ext4_xattr_entry *entry;
> > -       struct ext4_xattr_ibody_header *header;
> >         struct ext4_inode *raw_inode;
> >         struct ext4_iloc iloc;
> > 
> > @@ -1879,7 +1876,6 @@ int ext4_try_to_evict_inline_data(handle_t *handle,
> >                 return error;
> > 
> >         raw_inode = ext4_raw_inode(&iloc);
> > -       header = IHDR(inode, raw_inode);
> >         entry = (struct ext4_xattr_entry *)((void *)raw_inode +
> >                                             EXT4_I(inode)->i_inline_off);
> >         if (EXT4_XATTR_LEN(entry->e_name_len) +
> > diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> > index 9491ac0..38b5169 100644
> > --- a/fs/ext4/ioctl.c
> > +++ b/fs/ext4/ioctl.c
> > @@ -100,7 +100,6 @@ static long swap_inode_boot_loader(struct super_block *sb,
> >         handle_t *handle;
> >         int err;
> >         struct inode *inode_bl;
> > -       struct ext4_inode_info *ei;
> >         struct ext4_inode_info *ei_bl;
> >         struct ext4_sb_info *sbi;
> > 
> > @@ -115,7 +114,6 @@ static long swap_inode_boot_loader(struct super_block *sb,
> >         }
> > 
> >         sbi = EXT4_SB(sb);
> > -       ei = EXT4_I(inode);
> > 
> >         inode_bl = ext4_iget(sb, EXT4_BOOT_LOADER_INO);
> >         if (IS_ERR(inode_bl)) {
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] ext4: deleted "set but not used" variables
  2013-07-08  5:23 [PATCH] ext4: deleted "set but not used" variables jon ernst
  2013-07-08 23:37 ` Zheng Liu
@ 2014-01-11 18:27 ` Theodore Ts'o
  1 sibling, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2014-01-11 18:27 UTC (permalink / raw)
  To: jon ernst; +Cc: linux-ext4

On Mon, Jul 08, 2013 at 05:23:49AM +0000, jon ernst wrote:
> to delete "set but not used" variables
> 
> Signed-off-by: Jon Ernst <jonernst07@gmail.com>

Thanks for your patch!

My apologies for the delay in processing this patch; it fell through
the cracks and I found it while going through my backlog.  The set but
not used variable in ext4_ext_truncate() has since been addressed by
actually checking the error returns, but the set but not used
variables in ioctl.c and inline.c were still applicable, and I've
applied those portions of the patch to the ext4 tree.

	      	       	      	       - Ted

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

end of thread, other threads:[~2014-01-11 18:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-08  5:23 [PATCH] ext4: deleted "set but not used" variables jon ernst
2013-07-08 23:37 ` Zheng Liu
2013-07-08 23:38   ` Zheng Liu
2014-01-11 18:27 ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.