[-next] selinux: Make selinux_kernfs_init_security static
diff mbox series

Message ID 20190322140400.18892-1-yuehaibing@huawei.com
State Accepted
Headers show
Series
  • [-next] selinux: Make selinux_kernfs_init_security static
Related show

Commit Message

YueHaibing March 22, 2019, 2:04 p.m. UTC
From: YueHaibing <yuehaibing@huawei.com>

Fix sparse warning:

security/selinux/hooks.c:3389:5: warning:
 symbol 'selinux_kernfs_init_security' was not declared. Should it be static?

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 security/selinux/hooks.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ondrej Mosnacek March 22, 2019, 5:45 p.m. UTC | #1
On Fri, Mar 22, 2019 at 3:04 PM Yue Haibing <yuehaibing@huawei.com> wrote:
> From: YueHaibing <yuehaibing@huawei.com>
>
> Fix sparse warning:
>
> security/selinux/hooks.c:3389:5: warning:
>  symbol 'selinux_kernfs_init_security' was not declared. Should it be static?
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Yup, another trivial mistake on my part...

Acked-by: Ondrej Mosnacek <omosnace@redhat.com>

Thanks for catching that!

> ---
>  security/selinux/hooks.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index ab4b049..b6e6152 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -3386,8 +3386,8 @@ static int selinux_inode_copy_up_xattr(const char *name)
>
>  /* kernfs node operations */
>
> -int selinux_kernfs_init_security(struct kernfs_node *kn_dir,
> -                                struct kernfs_node *kn)
> +static int selinux_kernfs_init_security(struct kernfs_node *kn_dir,
> +                                       struct kernfs_node *kn)
>  {
>         const struct task_security_struct *tsec = current_security();
>         u32 parent_sid, newsid, clen;
> --
> 2.7.0
Paul Moore March 22, 2019, 8:02 p.m. UTC | #2
On Fri, Mar 22, 2019 at 1:46 PM Ondrej Mosnacek <omosnace@redhat.com> wrote:
> On Fri, Mar 22, 2019 at 3:04 PM Yue Haibing <yuehaibing@huawei.com> wrote:
> > From: YueHaibing <yuehaibing@huawei.com>
> >
> > Fix sparse warning:
> >
> > security/selinux/hooks.c:3389:5: warning:
> >  symbol 'selinux_kernfs_init_security' was not declared. Should it be static?
> >
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>
> Yup, another trivial mistake on my part...
>
> Acked-by: Ondrej Mosnacek <omosnace@redhat.com>
>
> Thanks for catching that!

Yes, thanks for the patch; I don't always check for static (or
const'ified args) as much as I should when reviewing code.  Merged
into selinux/next.
Mukesh Ojha March 27, 2019, 3:19 p.m. UTC | #3
On 3/22/2019 7:34 PM, Yue Haibing wrote:
> From: YueHaibing <yuehaibing@huawei.com>
>
> Fix sparse warning:
>
> security/selinux/hooks.c:3389:5: warning:
>   symbol 'selinux_kernfs_init_security' was not declared. Should it be static?
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

-Mukesh
> ---
>   security/selinux/hooks.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index ab4b049..b6e6152 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -3386,8 +3386,8 @@ static int selinux_inode_copy_up_xattr(const char *name)
>   
>   /* kernfs node operations */
>   
> -int selinux_kernfs_init_security(struct kernfs_node *kn_dir,
> -				 struct kernfs_node *kn)
> +static int selinux_kernfs_init_security(struct kernfs_node *kn_dir,
> +					struct kernfs_node *kn)
>   {
>   	const struct task_security_struct *tsec = current_security();
>   	u32 parent_sid, newsid, clen;

Patch
diff mbox series

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index ab4b049..b6e6152 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3386,8 +3386,8 @@  static int selinux_inode_copy_up_xattr(const char *name)
 
 /* kernfs node operations */
 
-int selinux_kernfs_init_security(struct kernfs_node *kn_dir,
-				 struct kernfs_node *kn)
+static int selinux_kernfs_init_security(struct kernfs_node *kn_dir,
+					struct kernfs_node *kn)
 {
 	const struct task_security_struct *tsec = current_security();
 	u32 parent_sid, newsid, clen;