2014-12-20 12:29:27

by Rickard Strandqvist

[permalink] [raw]
Subject: [PATCH] security: selinux: avc.c: Remove unused function

Remove the function avc_sidcmp() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <[email protected]>
---
security/selinux/avc.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index a18f1fa..afcc0ae 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -517,11 +517,6 @@ out:
return rc;
}

-static inline int avc_sidcmp(u32 x, u32 y)
-{
- return (x == y || x == SECSID_WILD || y == SECSID_WILD);
-}
-
/**
* avc_update_node Update an AVC entry
* @event : Updating event
--
1.7.10.4


2014-12-20 22:29:07

by Paul Moore

[permalink] [raw]
Subject: Re: [PATCH] security: selinux: avc.c: Remove unused function

On Saturday, December 20, 2014 01:32:10 PM Rickard Strandqvist wrote:
> Remove the function avc_sidcmp() that is not used anywhere.
>
> This was partially found by using a static code analysis program called
> cppcheck.
>
> Signed-off-by: Rickard Strandqvist <[email protected]>
> ---
> security/selinux/avc.c | 5 -----
> 1 file changed, 5 deletions(-)

Thanks, applied to the SELinux next branch with some minor changes to the
patch's subject line.

> diff --git a/security/selinux/avc.c b/security/selinux/avc.c
> index a18f1fa..afcc0ae 100644
> --- a/security/selinux/avc.c
> +++ b/security/selinux/avc.c
> @@ -517,11 +517,6 @@ out:
> return rc;
> }
>
> -static inline int avc_sidcmp(u32 x, u32 y)
> -{
> - return (x == y || x == SECSID_WILD || y == SECSID_WILD);
> -}
> -
> /**
> * avc_update_node Update an AVC entry
> * @event : Updating event

--
paul moore
http://www.paul-moore.com