All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cifs: remove redundant initialization to variable mnt_sign_enabled
@ 2022-06-28 21:32 Colin Ian King
  2022-07-03  4:28 ` Steve French
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-06-28 21:32 UTC (permalink / raw)
  To: Steve French, linux-cifs, samba-technical; +Cc: kernel-janitors, linux-kernel

Variable mnt_sign_enabled is being initialized with a value that
is never read, it is being reassigned later on with a different
value. The initialization is redundant and can be removed.

Cleans up clang scan-build warning:
fs/cifs/cifssmb.c:465:7: warning: Value stored to 'mnt_sign_enabled
 during its initialization is never read

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

diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 6371b9eebdad..9ed21752f2df 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -462,7 +462,7 @@ cifs_enable_signing(struct TCP_Server_Info *server, bool mnt_sign_required)
 {
 	bool srv_sign_required = server->sec_mode & server->vals->signing_required;
 	bool srv_sign_enabled = server->sec_mode & server->vals->signing_enabled;
-	bool mnt_sign_enabled = global_secflags & CIFSSEC_MAY_SIGN;
+	bool mnt_sign_enabled;
 
 	/*
 	 * Is signing required by mnt options? If not then check
-- 
2.35.3


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

* Re: [PATCH] cifs: remove redundant initialization to variable mnt_sign_enabled
  2022-06-28 21:32 [PATCH] cifs: remove redundant initialization to variable mnt_sign_enabled Colin Ian King
@ 2022-07-03  4:28 ` Steve French
  0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2022-07-03  4:28 UTC (permalink / raw)
  To: Colin Ian King; +Cc: Steve French, CIFS, samba-technical, kernel-janitors, LKML

merged into cifs-2.6.git for-next

On Tue, Jun 28, 2022 at 4:40 PM Colin Ian King <colin.i.king@gmail.com> wrote:
>
> Variable mnt_sign_enabled is being initialized with a value that
> is never read, it is being reassigned later on with a different
> value. The initialization is redundant and can be removed.
>
> Cleans up clang scan-build warning:
> fs/cifs/cifssmb.c:465:7: warning: Value stored to 'mnt_sign_enabled
>  during its initialization is never read
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  fs/cifs/cifssmb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> index 6371b9eebdad..9ed21752f2df 100644
> --- a/fs/cifs/cifssmb.c
> +++ b/fs/cifs/cifssmb.c
> @@ -462,7 +462,7 @@ cifs_enable_signing(struct TCP_Server_Info *server, bool mnt_sign_required)
>  {
>         bool srv_sign_required = server->sec_mode & server->vals->signing_required;
>         bool srv_sign_enabled = server->sec_mode & server->vals->signing_enabled;
> -       bool mnt_sign_enabled = global_secflags & CIFSSEC_MAY_SIGN;
> +       bool mnt_sign_enabled;
>
>         /*
>          * Is signing required by mnt options? If not then check
> --
> 2.35.3
>


-- 
Thanks,

Steve

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

end of thread, other threads:[~2022-07-03  4:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 21:32 [PATCH] cifs: remove redundant initialization to variable mnt_sign_enabled Colin Ian King
2022-07-03  4:28 ` Steve French

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.