diff mbox series

[-next] integrity: Make function integrity_add_key() static

Message ID 20210210080131.1209889-1-weiyongjun1@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] integrity: Make function integrity_add_key() static | expand

Commit Message

Wei Yongjun Feb. 10, 2021, 8:01 a.m. UTC
The sparse tool complains as follows:

security/integrity/digsig.c:146:12: warning:
 symbol 'integrity_add_key' was not declared. Should it be static?

This function is not used outside of digsig.c, so this
commit marks it static.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 security/integrity/digsig.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kees Cook Feb. 10, 2021, 8:52 p.m. UTC | #1
On Wed, Feb 10, 2021 at 08:01:31AM +0000, Wei Yongjun wrote:
> The sparse tool complains as follows:
> 
> security/integrity/digsig.c:146:12: warning:
>  symbol 'integrity_add_key' was not declared. Should it be static?
> 
> This function is not used outside of digsig.c, so this
> commit marks it static.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Kees Cook <keescook@chromium.org>
Nayna Feb. 12, 2021, 4:11 p.m. UTC | #2
On 2/10/21 3:01 AM, Wei Yongjun wrote:
> The sparse tool complains as follows:
>
> security/integrity/digsig.c:146:12: warning:
>   symbol 'integrity_add_key' was not declared. Should it be static?
>
> This function is not used outside of digsig.c, so this
> commit marks it static.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>   security/integrity/digsig.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c
> index 0f518dcfde05..250fb0836156 100644
> --- a/security/integrity/digsig.c
> +++ b/security/integrity/digsig.c
> @@ -143,8 +143,8 @@ int __init integrity_init_keyring(const unsigned int id)
>   	return __integrity_init_keyring(id, perm, restriction);
>   }
>
> -int __init integrity_add_key(const unsigned int id, const void *data,
> -			     off_t size, key_perm_t perm)
> +static int __init integrity_add_key(const unsigned int id, const void *data,
> +				    off_t size, key_perm_t perm)
>   {
>   	key_ref_t key;
>   	int rc = 0;

Reviewed-by: Nayna Jain <nayna@linux.ibm.com>


Thanks & Regards,
     - Nayna
Mimi Zohar Feb. 12, 2021, 4:21 p.m. UTC | #3
[Cc: linux-integrity]

On Wed, 2021-02-10 at 08:01 +0000, Wei Yongjun wrote:
> The sparse tool complains as follows:
> 
> security/integrity/digsig.c:146:12: warning:
>  symbol 'integrity_add_key' was not declared. Should it be static?
> 
> This function is not used outside of digsig.c, so this
> commit marks it static.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Thanks!   The patch is now queued.
  
Mimi
diff mbox series

Patch

diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c
index 0f518dcfde05..250fb0836156 100644
--- a/security/integrity/digsig.c
+++ b/security/integrity/digsig.c
@@ -143,8 +143,8 @@  int __init integrity_init_keyring(const unsigned int id)
 	return __integrity_init_keyring(id, perm, restriction);
 }
 
-int __init integrity_add_key(const unsigned int id, const void *data,
-			     off_t size, key_perm_t perm)
+static int __init integrity_add_key(const unsigned int id, const void *data,
+				    off_t size, key_perm_t perm)
 {
 	key_ref_t key;
 	int rc = 0;