Linux-Security-Module Archive on lore.kernel.org
 help / Atom feed
* [PATCH -next] evm: CHECK-remove set but not used variable 'xattr'
@ 2018-12-15  9:53 YueHaibing
  2018-12-15  9:56 ` YueHaibing
  2018-12-15 10:06 ` [PATCH -next] evm: remove " YueHaibing
  0 siblings, 2 replies; 4+ messages in thread
From: YueHaibing @ 2018-12-15  9:53 UTC (permalink / raw)
  To: Mimi Zohar, James Morris, Serge E. Hallyn
  Cc: YueHaibing, linux-integrity, linux-security-module, kernel-janitors

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);
-			}
 		}
 	}




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

* Re: [PATCH -next] evm: CHECK-remove set but not used variable 'xattr'
  2018-12-15  9:53 [PATCH -next] evm: CHECK-remove set but not used variable 'xattr' YueHaibing
@ 2018-12-15  9:56 ` YueHaibing
  2018-12-15 10:06 ` [PATCH -next] evm: remove " YueHaibing
  1 sibling, 0 replies; 4+ messages in thread
From: YueHaibing @ 2018-12-15  9:56 UTC (permalink / raw)
  To: Mimi Zohar, James Morris, Serge E. Hallyn
  Cc: linux-integrity, linux-security-module, kernel-janitors

Sorry, the patch title need fix, Pls ignore this.

On 2018/12/15 17:53, 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);
> -			}
>  		}
>  	}
> 
> 
> 
> 
> .
> 


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

* [PATCH -next] evm: remove set but not used variable 'xattr'
  2018-12-15  9:53 [PATCH -next] evm: CHECK-remove set but not used variable 'xattr' YueHaibing
  2018-12-15  9:56 ` YueHaibing
@ 2018-12-15 10:06 ` " YueHaibing
  2019-01-17  8:21   ` YueHaibing
  1 sibling, 1 reply; 4+ messages in thread
From: YueHaibing @ 2018-12-15 10:06 UTC (permalink / raw)
  To: Mimi Zohar, James Morris, Serge E. Hallyn
  Cc: YueHaibing, linux-integrity, linux-security-module, kernel-janitors

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);
-			}
 		}
 	}




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

* Re: [PATCH -next] evm: remove set but not used variable 'xattr'
  2018-12-15 10:06 ` [PATCH -next] evm: remove " YueHaibing
@ 2019-01-17  8:21   ` YueHaibing
  0 siblings, 0 replies; 4+ messages in thread
From: YueHaibing @ 2019-01-17  8:21 UTC (permalink / raw)
  To: Mimi Zohar, James Morris, Serge E. Hallyn
  Cc: linux-integrity, linux-security-module, kernel-janitors

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


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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-15  9:53 [PATCH -next] evm: CHECK-remove set but not used variable 'xattr' YueHaibing
2018-12-15  9:56 ` YueHaibing
2018-12-15 10:06 ` [PATCH -next] evm: remove " YueHaibing
2019-01-17  8:21   ` YueHaibing

Linux-Security-Module Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-security-module/0 linux-security-module/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-security-module linux-security-module/ https://lore.kernel.org/linux-security-module \
		linux-security-module@vger.kernel.org linux-security-module@archiver.kernel.org
	public-inbox-index linux-security-module


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-security-module


AGPL code for this site: git clone https://public-inbox.org/ public-inbox