Skip to contentSkip to conversation

x86/sgx: Make symbol 'sgx_vepc_vm_ops' static

PATCH Applied Wei Yongjun 4 participants 5 messages Apr 12, 2021 – Apr 14, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/sgx: Make symbol 'sgx_vepc_vm_ops' static

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.

---
 arch/x86/kernel/cpu/sgx/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/sgx/virt.c +1 -1
index 7d221eac716a..6ad165a5c0cc 100644
@@ -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,
 };
 
maintainer
#1 lore raw
Quoted 7 lines · Wei Yongjun

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.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#2 lore raw
Quoted 14 lines · Wei Yongjun
Quoted 7 lines

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.

Quoted 7 lines

Also, do

$ git grep 'This patch' Documentation/process

for more details.

Thx.

Got it, thanks.

Regards,
Wei Yongjun

merge bot Applied
#3 lore raw

[tip: x86/sgx] x86/sgx: Mark sgx_vepc_vm_ops static

In reply to Wei Yongjun
The following commit has been merged into the x86/sgx branch of tip:

The following commit has been merged into the x86/sgx branch of tip:

Commit-ID:     523caed9efbb049339706b124185c9358c1b6477
Gitweb:        https://git.kernel.org/tip/523caed9efbb049339706b124185c9358c1b6477
Author:        Wei Yongjun <[email protected]>
AuthorDate:    Mon, 12 Apr 2021 16:00:23 
Committer:     Borislav Petkov <[email protected]>
CommitterDate: Mon, 12 Apr 2021 19:48:32 +02:00

x86/sgx: Mark sgx_vepc_vm_ops static

Fix the following sparse warning:

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 mark it static.

[ bp: Massage commit message. ]

---
 arch/x86/kernel/cpu/sgx/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/sgx/virt.c +1 -1
index 7d221ea..6ad165a 100644
@@ -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,
 };
 
maintainer
#4 lore raw
In reply to Wei Yongjun
Quoted 11 lines · Wei Yongjun

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.

---

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

Quoted 18 lines
 arch/x86/kernel/cpu/sgx/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/sgx/virt.c +1 -1
index 7d221eac716a..6ad165a5c0cc 100644
@@ -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,
 };