raiden00pl commented on code in PR #18296:
URL: https://github.com/apache/nuttx/pull/18296#discussion_r2750857447


##########
arch/arm/src/stm32/stm32f10xxf30xx_flash.c:
##########
@@ -296,6 +296,31 @@ ssize_t up_progmem_write(size_t addr, const void *buf, 
size_t count)
 #if defined(STM32_FLASH_DUAL_BANK)
   /* Handle paged FLASH */
 
+  size_t flash_offset;
+  size_t page;
+
+  /* Compute flash offset */
+
+  if (addr >= STM32_FLASH_BASE)

Review Comment:
   this is already done below, why duplicate code? 
   
   ```
     /* Check for valid address range */
   
     if (addr >= STM32_FLASH_BASE)
       {
         addr -= STM32_FLASH_BASE;
       }
   
     if ((addr + count) > STM32_FLASH_SIZE)
       {
         return -EFAULT;
       }
   
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to