You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/02/03 21:20:22 UTC

[GitHub] [incubator-nuttx] a-lunev commented on a change in pull request #5403: bcm43xxx: fixed ISO C89/C90 related and other types of warnings

a-lunev commented on a change in pull request #5403:
URL: https://github.com/apache/incubator-nuttx/pull/5403#discussion_r798977782



##########
File path: drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_43362.c
##########
@@ -45,39 +45,41 @@ extern const uint8_t bcm43362_firmware_image[];
 extern const unsigned int bcm43362_firmware_image_len;
 #endif
 
-const struct bcmf_sdio_chip bcmf_43362_config_sdio =
+struct bcmf_sdio_chip bcmf_43362_config_sdio;

Review comment:
       Initially I was thinking about replacing {.ram_base = 0, .ram_size = 0x3c000, ... } by { 0,  0x3c000, ... }, however the main problem is with .core_base. There are defined indices for each core. The indices are defined by enum in bcmf_sdio_core.h. The existing approach is auto-synced. If we transform the existing initialization into {0x18000000,  0x18001000, 0x18002000, ...} the auto-sync will not work anymore, that is also dangerous. E.g. someone changes the sequence in the enum, then the referencing code will point out to wrong base addresses.
   Possibly it is reasonable then to replace the enum by number of separate defines?
   ```
   #define CHIPCOMMON_CORE_ID  0
   #define DOT11MAC_CORE_ID  1
   #define SDIOD_CORE_ID  2
   ...
   
   ```
   I hope in that case a developer who will modify the code in the future should be aware that the defines are not flexible rather than enum is. 
   What do you think?




-- 
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-unsubscribe@nuttx.apache.org

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