pussuw commented on code in PR #15396:
URL: https://github.com/apache/nuttx/pull/15396#discussion_r1906705437


##########
arch/risc-v/src/common/riscv_cpuindex.c:
##########
@@ -38,32 +36,30 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_cpu_index
+ * Name: up_this_cpu
  *
  * Description:
- *   Return the real core number regardless CONFIG_SMP setting
+ *   Return the logical core number. Default implementation is 1:1 mapping,
+ *   i.e. physical=logical.
  *
  ****************************************************************************/
 
-#ifdef CONFIG_RISCV_PERCPU_SCRATCH
-int up_cpu_index(void)
+int up_this_cpu(void)
 {
-  return (int)riscv_mhartid();
+  return riscv_hartid_to_cpuid((int)riscv_mhartid());
 }
-#endif
 
 /****************************************************************************
- * Name: up_this_cpu
+ * Name: up_cpu_index
  *
  * Description:
- *   Return the logical core number. Default implementation is 1:1 mapping,
- *   i.e. physical=logical.
+ *   Return the real core number regardless CONFIG_SMP setting
  *
  ****************************************************************************/
 
-int up_this_cpu(void)
+int up_cpu_index(void)
 {
-  return riscv_hartid_to_cpuid((int)riscv_mhartid());

Review Comment:
   Please restore the original ordering to keep the change as small as possible?



##########
arch/risc-v/src/common/riscv_cpuindex.c:
##########
@@ -38,32 +36,30 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_cpu_index
+ * Name: up_this_cpu
  *
  * Description:
- *   Return the real core number regardless CONFIG_SMP setting
+ *   Return the logical core number. Default implementation is 1:1 mapping,
+ *   i.e. physical=logical.
  *
  ****************************************************************************/
 
-#ifdef CONFIG_RISCV_PERCPU_SCRATCH
-int up_cpu_index(void)
+int up_this_cpu(void)
 {
-  return (int)riscv_mhartid();
+  return riscv_hartid_to_cpuid((int)riscv_mhartid());
 }
-#endif
 
 /****************************************************************************
- * Name: up_this_cpu
+ * Name: up_cpu_index
  *
  * Description:
- *   Return the logical core number. Default implementation is 1:1 mapping,
- *   i.e. physical=logical.
+ *   Return the real core number regardless CONFIG_SMP setting
  *
  ****************************************************************************/
 
-int up_this_cpu(void)
+int up_cpu_index(void)
 {
-  return riscv_hartid_to_cpuid((int)riscv_mhartid());

Review Comment:
   Please restore the original function ordering to keep the change as small as 
possible?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to