diff mbox series

[2/2] proc01: remove unused lsm_should_work (-Wunused-const-variable)

Message ID 20210701122351.56397-2-krzysztof.kozlowski@canonical.com
State Superseded
Headers show
Series [1/2] proc01: fix selinux attributes without libselinux-dev | expand

Commit Message

Krzysztof Kozlowski July 1, 2021, 12:23 p.m. UTC
Recent refactoring made the "lsm_should_work" unused without
libselinux-dev:

    proc01.c:142:19: warning: ‘lsm_should_work’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 testcases/kernel/fs/proc/proc01.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Krzysztof Kozlowski July 1, 2021, 12:29 p.m. UTC | #1
On 01/07/2021 14:23, Krzysztof Kozlowski wrote:
> Recent refactoring made the "lsm_should_work" unused without
> libselinux-dev:
> 
>     proc01.c:142:19: warning: ‘lsm_should_work’ defined but not used [-Wunused-const-variable=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>  testcases/kernel/fs/proc/proc01.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/testcases/kernel/fs/proc/proc01.c b/testcases/kernel/fs/proc/proc01.c
> index 282c70e94882..c90e509a3243 100644
> --- a/testcases/kernel/fs/proc/proc01.c
> +++ b/testcases/kernel/fs/proc/proc01.c
> @@ -137,12 +137,7 @@ static const char lsm_should_work[][PATH_MAX] = {
>  	"/proc/self/attr/*",
>  	"/proc/self/attr/selinux/*",
>  	"/proc/self/task/[0-9]*/attr/*",
> -	""
> -};
> -
> -/* Place holder for none of LSM is detected. */
> -#else
> -static const char lsm_should_work[][PATH_MAX] = {
> +	"/proc/self/task/[0-9]*/attr/selinux/*",

This should be part of previous patch, my bad with git add -p. I'll send
a v2.


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/testcases/kernel/fs/proc/proc01.c b/testcases/kernel/fs/proc/proc01.c
index 282c70e94882..c90e509a3243 100644
--- a/testcases/kernel/fs/proc/proc01.c
+++ b/testcases/kernel/fs/proc/proc01.c
@@ -137,12 +137,7 @@  static const char lsm_should_work[][PATH_MAX] = {
 	"/proc/self/attr/*",
 	"/proc/self/attr/selinux/*",
 	"/proc/self/task/[0-9]*/attr/*",
-	""
-};
-
-/* Place holder for none of LSM is detected. */
-#else
-static const char lsm_should_work[][PATH_MAX] = {
+	"/proc/self/task/[0-9]*/attr/selinux/*",
 	""
 };
 #endif