Skip to contentSkip to conversation

x86/sgx: Describe the parameters of sgx_calc_section_metric()

PATCH In review Jarkko Sakkinen 2 participants 3 messages Aug 22, 2023 – Aug 27, 2023

Subsystems (3)
lore
Share & tools
lore

Jarkko Sakkinen

author maintainer
#0 lore raw

PATCH 1/1 x86/sgx: Describe the parameters of sgx_calc_section_metric()

Cc [email protected] # v5.11+
Fixes e7e0545299d8 ("x86/sgx: Initialize metadata for Enclave Page Cache (EPC) sections")
---
 arch/x86/kernel/cpu/sgx/main.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/x86/kernel/cpu/sgx/main.c +4 -0
index 166692f2d501..388350b8f5e3 100644
@@ -732,6 +732,10 @@ int arch_memory_failure(unsigned long pfn, int flags)
 }
 
 /**
+ * sgx_calc_section_metric() - Calculate an EPC section metric
+ * @low:	low 32-bit word from CPUID:0x12:{2, ...}
+ * @high:	high 32-bit word from CPUID:0x12:{2, ...}
+ *
  * A section metric is concatenated in a way that @low bits 12-31 define the
  * bits 12-31 of the metric and @high bits 0-19 define the bits 32-51 of the
  * metric.
Signature · 1 line
2.39.2
#1 lore raw
Quoted 5 lines · Jarkko Sakkinen
Cc [email protected] # v5.11+
Fixes e7e0545299d8 ("x86/sgx: Initialize metadata for Enclave Page Cache (EPC) sections")

-ENOCHANGELOG

Quoted 8 lines

/**
+ * sgx_calc_section_metric() - Calculate an EPC section metric
+ * @low: low 32-bit word from CPUID:0x12:{2, ...}
+ * @high: high 32-bit word from CPUID:0x12:{2, ...}
+ *
* A section metric is concatenated in a way that @low bits 12-31 define the
* bits 12-31 of the metric and @high bits 0-19 define the bits 32-51 of the
* metric.

Shouldn't we just do:

- /**
+ /*

? This doesn't need kerneldoc comments.

author maintainer
#2 lore raw
Quoted 8 lines · Dave Hansen
Quoted 5 lines · Jarkko Sakkinen
Cc [email protected] # v5.11+
Fixes e7e0545299d8 ("x86/sgx: Initialize metadata for Enclave Page Cache (EPC) sections")

-ENOCHANGELOG

ack

Quoted 14 lines
Quoted 8 lines

/**
+ * sgx_calc_section_metric() - Calculate an EPC section metric
+ * @low: low 32-bit word from CPUID:0x12:{2, ...}
+ * @high: high 32-bit word from CPUID:0x12:{2, ...}
+ *
* A section metric is concatenated in a way that @low bits 12-31 define the
* bits 12-31 of the metric and @high bits 0-19 define the bits 32-51 of the
* metric.

Shouldn't we just do:

(quoted diff) +1 -1
-  /**
+  /*
Quoted 1 line

? This doesn't need kerneldoc comments.

Yeah, I added it because of parameter descriptions, which I think are still useful.

If checkpatch does not complain, I can change the comment type.

BR, Jarkko