diff mbox series

[-next] x86/sgx: Make symbol 'sgx_vepc_vm_ops' static

Message ID 20210412160023.193850-1-weiyongjun1@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] x86/sgx: Make symbol 'sgx_vepc_vm_ops' static | expand

Commit Message

weiyongjun (A) April 12, 2021, 4 p.m. UTC
The sparse tool complains as follows:

arch/x86/kernel/cpu/sgx/virt.c:95:35: warning:
 symbol 'sgx_vepc_vm_ops' was not declared. Should it be static?

This symbol is not used outside of virt.c, so this
commit marks it static.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 arch/x86/kernel/cpu/sgx/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Borislav Petkov April 12, 2021, 5:46 p.m. UTC | #1
On Mon, Apr 12, 2021 at 04:00:23PM +0000, Wei Yongjun wrote:
> The sparse tool complains as follows:
> 
> arch/x86/kernel/cpu/sgx/virt.c:95:35: warning:
>  symbol 'sgx_vepc_vm_ops' was not declared. Should it be static?
> 
> This symbol is not used outside of virt.c, so this
> commit marks it static.

For the future:

Avoid having "This patch" or "This commit" in the commit message. It is
tautologically useless.

Also, do

$ git grep 'This patch' Documentation/process

for more details.

Thx.
weiyongjun (A) April 13, 2021, 7:19 a.m. UTC | #2
> 
> On Mon, Apr 12, 2021 at 04:00:23PM +0000, Wei Yongjun wrote:
> > The sparse tool complains as follows:
> >
> > arch/x86/kernel/cpu/sgx/virt.c:95:35: warning:
> >  symbol 'sgx_vepc_vm_ops' was not declared. Should it be static?
> >
> > This symbol is not used outside of virt.c, so this commit marks it
> > static.
> 
> For the future:
> 
> Avoid having "This patch" or "This commit" in the commit message. It is tautologically useless.
> 
> Also, do
> 
> $ git grep 'This patch' Documentation/process
> 
> for more details.
> 
> Thx.


Got it, thanks.

Regards,
Wei Yongjun
Jarkko Sakkinen April 14, 2021, 11:11 a.m. UTC | #3
On Mon, Apr 12, 2021 at 04:00:23PM +0000, Wei Yongjun wrote:
> The sparse tool complains as follows:
> 
> arch/x86/kernel/cpu/sgx/virt.c:95:35: warning:
>  symbol 'sgx_vepc_vm_ops' was not declared. Should it be static?
> 
> This symbol is not used outside of virt.c, so this
> commit marks it static.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---

The only reason I cannot ack this is that instead telling what the
commit does, the long description asks should this be done or not.


/Jarkko

>  arch/x86/kernel/cpu/sgx/virt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/cpu/sgx/virt.c b/arch/x86/kernel/cpu/sgx/virt.c
> index 7d221eac716a..6ad165a5c0cc 100644
> --- a/arch/x86/kernel/cpu/sgx/virt.c
> +++ b/arch/x86/kernel/cpu/sgx/virt.c
> @@ -92,7 +92,7 @@ static vm_fault_t sgx_vepc_fault(struct vm_fault *vmf)
>  	return VM_FAULT_SIGBUS;
>  }
>  
> -const struct vm_operations_struct sgx_vepc_vm_ops = {
> +static const struct vm_operations_struct sgx_vepc_vm_ops = {
>  	.fault = sgx_vepc_fault,
>  };
>  
> 
>
diff mbox series

Patch

diff --git a/arch/x86/kernel/cpu/sgx/virt.c b/arch/x86/kernel/cpu/sgx/virt.c
index 7d221eac716a..6ad165a5c0cc 100644
--- a/arch/x86/kernel/cpu/sgx/virt.c
+++ b/arch/x86/kernel/cpu/sgx/virt.c
@@ -92,7 +92,7 @@  static vm_fault_t sgx_vepc_fault(struct vm_fault *vmf)
 	return VM_FAULT_SIGBUS;
 }
 
-const struct vm_operations_struct sgx_vepc_vm_ops = {
+static const struct vm_operations_struct sgx_vepc_vm_ops = {
 	.fault = sgx_vepc_fault,
 };