diff mbox series

[-next] evm: remove set but not used variable 'xattr'

Message ID 1544868370-83459-1-git-send-email-yuehaibing@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] evm: remove set but not used variable 'xattr' | expand

Commit Message

Yue Haibing Dec. 15, 2018, 10:06 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

security/integrity/evm/evm_main.c: In function 'init_evm':
security/integrity/evm/evm_main.c:566:21: warning:
 variable 'xattr' set but not used [-Wunused-but-set-variable]

It never used since commit 21af76631476 ("EVM: turn evm_config_xattrnames
into a list")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 security/integrity/evm/evm_main.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Yue Haibing Jan. 17, 2019, 8:21 a.m. UTC | #1
ping...

On 2018/12/15 18:06, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> security/integrity/evm/evm_main.c: In function 'init_evm':
> security/integrity/evm/evm_main.c:566:21: warning:
>  variable 'xattr' set but not used [-Wunused-but-set-variable]
> 
> It never used since commit 21af76631476 ("EVM: turn evm_config_xattrnames
> into a list")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  security/integrity/evm/evm_main.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c
> index 5ecaa3d..b6d9f14 100644
> --- a/security/integrity/evm/evm_main.c
> +++ b/security/integrity/evm/evm_main.c
> @@ -563,7 +563,6 @@ static int __init init_evm(void)
>  {
>  	int error;
>  	struct list_head *pos, *q;
> -	struct xattr_list *xattr;
>  
>  	evm_init_config();
>  
> @@ -580,11 +579,8 @@ static int __init init_evm(void)
>  error:
>  	if (error != 0) {
>  		if (!list_empty(&evm_config_xattrnames)) {
> -			list_for_each_safe(pos, q, &evm_config_xattrnames) {
> -				xattr = list_entry(pos, struct xattr_list,
> -						   list);
> +			list_for_each_safe(pos, q, &evm_config_xattrnames)
>  				list_del(pos);
> -			}
>  		}
>  	}
> 
> 
> 
> 
> .
>
Mimi Zohar Jan. 23, 2019, 6:38 p.m. UTC | #2
On Thu, 2019-01-17 at 16:21 +0800, YueHaibing wrote:
> ping...
> 
> On 2018/12/15 18:06, YueHaibing wrote:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > security/integrity/evm/evm_main.c: In function 'init_evm':
> > security/integrity/evm/evm_main.c:566:21: warning:
> >  variable 'xattr' set but not used [-Wunused-but-set-variable]
> > 
> > It never used since commit 21af76631476 ("EVM: turn evm_config_xattrnames
> > into a list")
> > 
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Thank you.  This patch is now queued in the next-integrity branch of
https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git

Mimi

> > ---
> >  security/integrity/evm/evm_main.c | 6 +-----
> >  1 file changed, 1 insertion(+), 5 deletions(-)
> > 
> > diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c
> > index 5ecaa3d..b6d9f14 100644
> > --- a/security/integrity/evm/evm_main.c
> > +++ b/security/integrity/evm/evm_main.c
> > @@ -563,7 +563,6 @@ static int __init init_evm(void)
> >  {
> >  	int error;
> >  	struct list_head *pos, *q;
> > -	struct xattr_list *xattr;
> >  
> >  	evm_init_config();
> >  
> > @@ -580,11 +579,8 @@ static int __init init_evm(void)
> >  error:
> >  	if (error != 0) {
> >  		if (!list_empty(&evm_config_xattrnames)) {
> > -			list_for_each_safe(pos, q, &evm_config_xattrnames) {
> > -				xattr = list_entry(pos, struct xattr_list,
> > -						   list);
> > +			list_for_each_safe(pos, q, &evm_config_xattrnames)
> >  				list_del(pos);
> > -			}
> >  		}
> >  	}
> > 
> > 
> > 
> > 
> > .
> > 
>
diff mbox series

Patch

diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c
index 5ecaa3d..b6d9f14 100644
--- a/security/integrity/evm/evm_main.c
+++ b/security/integrity/evm/evm_main.c
@@ -563,7 +563,6 @@  static int __init init_evm(void)
 {
 	int error;
 	struct list_head *pos, *q;
-	struct xattr_list *xattr;
 
 	evm_init_config();
 
@@ -580,11 +579,8 @@  static int __init init_evm(void)
 error:
 	if (error != 0) {
 		if (!list_empty(&evm_config_xattrnames)) {
-			list_for_each_safe(pos, q, &evm_config_xattrnames) {
-				xattr = list_entry(pos, struct xattr_list,
-						   list);
+			list_for_each_safe(pos, q, &evm_config_xattrnames)
 				list_del(pos);
-			}
 		}
 	}