pkarashchenko commented on code in PR #7160: URL: https://github.com/apache/incubator-nuttx/pull/7160#discussion_r977789635
########## arch/arm/src/cxd56xx/cxd56_allocateheap.c: ########## @@ -115,7 +115,7 @@ void up_allocate_heap(void **heap_start, size_t *heap_size) board_autoled_on(LED_HEAPALLOCATE); *heap_start = (void *)g_idle_topstack; - *heap_size = (uint32_t)&__stack - g_idle_topstack; + *heap_size = (uint32_t)__stack - g_idle_topstack; Review Comment: ```suggestion *heap_size = __stack - g_idle_topstack; ``` ########## arch/arm/src/rtl8720c/ameba_nvic.c: ########## @@ -316,7 +316,7 @@ void up_irqinitialize(void) /* Restore the NVIC vector location to local */ - memcpy(&__vectors, (void *) * (volatile uint32_t *)(NVIC_VECTAB) + memcpy(__vectors, (void *) * (volatile uint32_t *)(NVIC_VECTAB) Review Comment: seems that `sizeof(__vectors)` is now 0 ########## arch/arm/src/stm32wb/stm32wb_start.c: ########## @@ -59,7 +59,7 @@ * the stack + 4; */ -#define HEAP_BASE ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE) +#define HEAP_BASE ((uintptr_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE) Review Comment: ```suggestion #define HEAP_BASE ((uintptr_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE) ``` ########## libs/libc/misc/lib_cxx_initialize.c: ########## @@ -71,11 +71,11 @@ void lib_cxx_initialize(void) #else initializer_t *initp; - sinfo("_sinit: %p _einit: %p\n", &_sinit, &_einit); + sinfo("_sinit: %p _einit: %p\n", _sinit, _einit); /* Visit each entry in the initialization table */ - for (initp = &_sinit; initp != &_einit; initp++) + for (initp = _sinit; initp != _einit; initp++) Review Comment: ```suggestion for (initp = _sinit; initp < _einit; initp++) ``` should not happen, but just for safety reasons ########## arch/arm/src/cxd56xx/cxd56_farapi.c: ########## @@ -106,7 +106,7 @@ struct farmsg_s * Public Data ****************************************************************************/ -extern char _image_modlist_base[]; +extern uint8_t _image_modlist_base[]; Review Comment: ```suggestion extern struct modulelist_s _image_modlist_base[]; ``` ########## arch/arm/src/cxd56xx/cxd56_farapi.c: ########## @@ -230,7 +230,7 @@ void farapi_main(int id, void *arg, struct modulelist_s *mlist) api = &msg.u.api; msg.cpuid = getreg32(CPU_ID); - msg.modid = mlist - (struct modulelist_s *)&_image_modlist_base; + msg.modid = mlist - (struct modulelist_s *)_image_modlist_base; Review Comment: ```suggestion msg.modid = mlist - _image_modlist_base; ``` ########## arch/arm/src/rp2040/rp2040_start.c: ########## @@ -41,7 +41,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define IDLE_STACK ((uint32_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE) +#define IDLE_STACK ((uint32_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE) Review Comment: ```suggestion #define IDLE_STACK ((uint32_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE) ``` maybe even better to ```suggestion #define IDLE_STACK ((uintptr_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE) ``` since `const uintptr_t g_idle_topstack = IDLE_STACK;` ########## arch/arm/src/stm32l4/stm32l4_start.c: ########## @@ -61,7 +61,7 @@ #define SRAM2_START STM32L4_SRAM2_BASE #define SRAM2_END (SRAM2_START + STM32L4_SRAM2_SIZE) -#define HEAP_BASE ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE) +#define HEAP_BASE ((uintptr_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE) Review Comment: ```suggestion #define HEAP_BASE ((uintptr_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE) ``` ########## arch/arm/src/stm32h7/stm32_start.c: ########## @@ -62,7 +62,7 @@ * 0x2005:ffff - End of internal SRAM and end of heap (a */ -#define HEAP_BASE ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE) +#define HEAP_BASE ((uintptr_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE) Review Comment: ```suggestion #define HEAP_BASE ((uintptr_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE) ``` ########## arch/arm/src/tlsr82/tlsr82_start.c: ########## @@ -84,13 +84,13 @@ void __tc32_start(void) tlsr82_clock_init(); #ifdef CONFIG_SCHED_BACKTRACE - extern uint32_t _sramcode; - extern uint32_t _eramcode; + extern uint8_t _sramcode[]; + extern uint8_t _eramcode[]; static void *g_code_regions[] = { - &_stext , &_etext, - &_sramcode, &_eramcode, - NULL , NULL, + _stext , _etext, + _sramcode, _eramcode, + NULL , NULL, }; extern void up_backtrace_init_code_regions(void **regions); Review Comment: Maybe this ca be moved out of the function? ########## arch/arm/src/samd2l2/sam_start.c: ########## @@ -53,7 +53,7 @@ * 0x2000:ffff - End of SRAM and end of heap (assuming 64KB of SRAM) */ -#define IDLE_STACK ((uint32_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE) +#define IDLE_STACK ((uint32_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE) Review Comment: ```suggestion #define IDLE_STACK ((uint32_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE) ``` ########## arch/arm/src/xmc4/xmc4_start.c: ########## @@ -66,7 +66,7 @@ static inline void xmc4_flash_waitstates(void); * 0x2002:ffff - End of internal SRAM and end of heap (a */ -#define HEAP_BASE ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE) +#define HEAP_BASE ((uintptr_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE) Review Comment: ```suggestion #define HEAP_BASE ((uintptr_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE) ``` -- 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