linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] security/smack: remove unused varible 'rc'
@ 2020-11-08  6:45 Alex Shi
  2020-11-16 22:31 ` Casey Schaufler
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Shi @ 2020-11-08  6:45 UTC (permalink / raw)
  Cc: Casey Schaufler, James Morris, Serge E. Hallyn,
	linux-security-module, linux-kernel

This varible isn't used and can be removed to avoid a gcc warning:
security/smack/smack_lsm.c:3873:6: warning: variable ‘rc’ set but not
used [-Wunused-but-set-variable]

Signed-off-by: Alex Shi <alex.shi@linux.alibaba.com>
Cc: Casey Schaufler <casey@schaufler-ca.com> 
Cc: James Morris <jmorris@namei.org> 
Cc: "Serge E. Hallyn" <serge@hallyn.com> 
Cc: linux-security-module@vger.kernel.org 
Cc: linux-kernel@vger.kernel.org 
---
 security/smack/smack_lsm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 5c90b9fa4d40..9994fcfafd70 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -3870,7 +3870,6 @@ static struct smack_known *smack_from_netlbl(struct sock *sk, u16 family,
 	struct netlbl_lsm_secattr secattr;
 	struct socket_smack *ssp = NULL;
 	struct smack_known *skp = NULL;
-	int rc;
 
 	netlbl_secattr_init(&secattr);
 
@@ -3880,7 +3879,7 @@ static struct smack_known *smack_from_netlbl(struct sock *sk, u16 family,
 	if (netlbl_skbuff_getattr(skb, family, &secattr) == 0) {
 		skp = smack_from_secattr(&secattr, ssp);
 		if (secattr.flags & NETLBL_SECATTR_CACHEABLE)
-			rc = netlbl_cache_add(skb, family, &skp->smk_netlabel);
+			netlbl_cache_add(skb, family, &skp->smk_netlabel);
 	}
 
 	netlbl_secattr_destroy(&secattr);
-- 
1.8.3.1


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

* Re: [PATCH] security/smack: remove unused varible 'rc'
  2020-11-08  6:45 [PATCH] security/smack: remove unused varible 'rc' Alex Shi
@ 2020-11-16 22:31 ` Casey Schaufler
  0 siblings, 0 replies; 2+ messages in thread
From: Casey Schaufler @ 2020-11-16 22:31 UTC (permalink / raw)
  To: Alex Shi
  Cc: James Morris, Serge E. Hallyn, linux-security-module,
	linux-kernel, Casey Schaufler

On 11/7/2020 10:45 PM, Alex Shi wrote:
> This varible isn't used and can be removed to avoid a gcc warning:
> security/smack/smack_lsm.c:3873:6: warning: variable ‘rc’ set but not
> used [-Wunused-but-set-variable]
>
> Signed-off-by: Alex Shi <alex.shi@linux.alibaba.com>
> Cc: Casey Schaufler <casey@schaufler-ca.com> 
> Cc: James Morris <jmorris@namei.org> 
> Cc: "Serge E. Hallyn" <serge@hallyn.com> 
> Cc: linux-security-module@vger.kernel.org 
> Cc: linux-kernel@vger.kernel.org 

I will take this through the Smack tree. Thank you.

> ---
>  security/smack/smack_lsm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
> index 5c90b9fa4d40..9994fcfafd70 100644
> --- a/security/smack/smack_lsm.c
> +++ b/security/smack/smack_lsm.c
> @@ -3870,7 +3870,6 @@ static struct smack_known *smack_from_netlbl(struct sock *sk, u16 family,
>  	struct netlbl_lsm_secattr secattr;
>  	struct socket_smack *ssp = NULL;
>  	struct smack_known *skp = NULL;
> -	int rc;
>  
>  	netlbl_secattr_init(&secattr);
>  
> @@ -3880,7 +3879,7 @@ static struct smack_known *smack_from_netlbl(struct sock *sk, u16 family,
>  	if (netlbl_skbuff_getattr(skb, family, &secattr) == 0) {
>  		skp = smack_from_secattr(&secattr, ssp);
>  		if (secattr.flags & NETLBL_SECATTR_CACHEABLE)
> -			rc = netlbl_cache_add(skb, family, &skp->smk_netlabel);
> +			netlbl_cache_add(skb, family, &skp->smk_netlabel);
>  	}
>  
>  	netlbl_secattr_destroy(&secattr);

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

end of thread, other threads:[~2020-11-16 22:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-08  6:45 [PATCH] security/smack: remove unused varible 'rc' Alex Shi
2020-11-16 22:31 ` Casey Schaufler

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).