All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kari Argillander <kari.argillander@gmail.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org,
	clang-built-linux@googlegroups.com
Subject: Re: [PATCH] fs/ntfs3: Remove unused variable cnt in ntfs_security_init()
Date: Tue, 17 Aug 2021 02:36:05 +0300	[thread overview]
Message-ID: <20210816233605.w2csfyhmebicw6k7@kari-VirtualBox> (raw)
In-Reply-To: <20210816193041.1164125-1-nathan@kernel.org>

On Mon, Aug 16, 2021 at 12:30:41PM -0700, Nathan Chancellor wrote:
> Clang warns:
> 
> fs/ntfs3/fsntfs.c:1874:9: warning: variable 'cnt' set but not used
> [-Wunused-but-set-variable]
>         size_t cnt, off;
>                ^
> 1 warning generated.
> 
> It is indeed unused so remove it.
> 
> Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Looks like it was used for debugging or way before index_find_raw()
needed hint or something. So this should be ok.

Reviewed-by: Kari Argillander <kari.argillander@gmail.com>

> ---
>  fs/ntfs3/fsntfs.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c
> index 92140050fb6c..c6599c514acf 100644
> --- a/fs/ntfs3/fsntfs.c
> +++ b/fs/ntfs3/fsntfs.c
> @@ -1871,7 +1871,7 @@ int ntfs_security_init(struct ntfs_sb_info *sbi)
>  	struct ATTRIB *attr;
>  	struct ATTR_LIST_ENTRY *le;
>  	u64 sds_size;
> -	size_t cnt, off;
> +	size_t off;
>  	struct NTFS_DE *ne;
>  	struct NTFS_DE_SII *sii_e;
>  	struct ntfs_fnd *fnd_sii = NULL;
> @@ -1946,7 +1946,6 @@ int ntfs_security_init(struct ntfs_sb_info *sbi)
>  	sbi->security.next_off =
>  		Quad2Align(sds_size - SecurityDescriptorsBlockSize);
>  
> -	cnt = 0;
>  	off = 0;
>  	ne = NULL;
>  
> @@ -1964,8 +1963,6 @@ int ntfs_security_init(struct ntfs_sb_info *sbi)
>  		next_id = le32_to_cpu(sii_e->sec_id) + 1;
>  		if (next_id >= sbi->security.next_id)
>  			sbi->security.next_id = next_id;
> -
> -		cnt += 1;
>  	}
>  
>  	sbi->security.ni = ni;
> 
> base-commit: 96b18047a7172037ff4206720f4e889670030b41
> -- 
> 2.33.0.rc2
> 
> 

  parent reply	other threads:[~2021-08-16 23:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 19:30 [PATCH] fs/ntfs3: Remove unused variable cnt in ntfs_security_init() Nathan Chancellor
2021-08-16 21:56 ` Nick Desaulniers
2021-08-16 21:56   ` Nick Desaulniers
2021-08-16 23:36 ` Kari Argillander [this message]
2021-08-27 16:12 ` Konstantin Komarov
2021-08-27 16:12   ` Konstantin Komarov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210816233605.w2csfyhmebicw6k7@kari-VirtualBox \
    --to=kari.argillander@gmail.com \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=ntfs3@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.