diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_bringup.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_bringup.c index a99ad80c035..114862711ad 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_bringup.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_bringup.c @@ -121,6 +121,7 @@ static int nsh_sdmmc_initialize(void) ret); } } + return OK; } #else diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_bringup.c index a1bde89991f..65d9cab5946 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_bringup.c @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_bringup.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - *****************************************************************************/ + ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Included Files - *****************************************************************************/ + ****************************************************************************/ #include @@ -76,11 +76,11 @@ #include "lpc17_40_symtab.h" #include "lpc17_40_progmem.h" -/***************************************************************************** +/**************************************************************************** * Pre-processor Definitions - *****************************************************************************/ + ****************************************************************************/ -/* Configuration *************************************************************/ +/* Configuration ************************************************************/ /* PORT and SLOT number probably depend on the board configuration */ @@ -97,9 +97,9 @@ # undef CONFIG_NSH_HAVEUSBDEV #endif -/***************************************************************************** +/**************************************************************************** * Public Functions - *****************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: pnev5180b_bringup @@ -133,7 +133,8 @@ int pnev5180b_bringup(void) ret = nx_mount(NULL, "/bin", "binfs", 0, NULL); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to mount the BIN filesystem: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to mount the BIN filesystem: %d\n", + ret); goto done; } #endif @@ -166,7 +167,8 @@ int pnev5180b_bringup(void) ret = lpc17_40_romfs_initialize(); if (ret != OK) { - syslog(LOG_ERR, "ERROR: lpc17_40_romfs_initialize() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: lpc17_40_romfs_initialize() failed: %d\n", + ret); goto done; } #endif diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.c b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.c index 41636d18d61..96616afd56c 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.c @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.c * This file provides contents of an optional ROMFS volume, mounted at boot. * @@ -39,7 +39,7 @@ * ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Included Files ****************************************************************************/ diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c index 14a57ec0015..7df1aa05a14 100644 --- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c +++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_appinit.c @@ -105,7 +105,7 @@ static int nsh_spifi_initialize(void) } #ifndef CONFIG_SPFI_NXFFS - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ ret = ftl_initialize(CONFIG_SPIFI_DEVNO, mtd); if (ret < 0) diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_appinit.c b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_appinit.c index 46b7471b209..a9e9d38bade 100644 --- a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_appinit.c +++ b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_appinit.c @@ -96,7 +96,7 @@ static int nsh_spifi_initialize(void) } #ifndef CONFIG_SPFI_NXFFS - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ ret = ftl_initialize(CONFIG_SPIFI_DEVNO, mtd); if (ret < 0) diff --git a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_appinit.c b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_appinit.c index 55984950f6d..8d86fb9b93a 100644 --- a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_appinit.c +++ b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_appinit.c @@ -96,7 +96,7 @@ static int nsh_spifi_initialize(void) } #ifndef CONFIG_SPFI_NXFFS - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ ret = ftl_initialize(CONFIG_SPIFI_DEVNO, mtd); if (ret < 0) diff --git a/boards/arm/sama5/sama5d2-xult/src/sam_at25.c b/boards/arm/sama5/sama5d2-xult/src/sam_at25.c index d839b727be3..b51393a3bbe 100644 --- a/boards/arm/sama5/sama5d2-xult/src/sam_at25.c +++ b/boards/arm/sama5/sama5d2-xult/src/sam_at25.c @@ -80,13 +80,13 @@ int sam_at25_automount(int minor) mtd = at25_initialize(spi); if (!mtd) { - ferr("ERROR: Failed to bind SPI port %d to the AT25 FLASH driver\n"); + ferr("ERROR: Failed to bind SPI port %d to AT25 FLASH driver\n"); return -ENODEV; } #if defined(CONFIG_SAMA5D3XPLAINED_AT25_FTL) - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ ret = ftl_initialize(AT25_MINOR, mtd); if (ret < 0) diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_at25.c b/boards/arm/sama5/sama5d3-xplained/src/sam_at25.c index e31c7aa6de1..d5a67ff1293 100644 --- a/boards/arm/sama5/sama5d3-xplained/src/sam_at25.c +++ b/boards/arm/sama5/sama5d3-xplained/src/sam_at25.c @@ -95,13 +95,13 @@ int sam_at25_automount(int minor) mtd = at25_initialize(spi); if (!mtd) { - ferr("ERROR: Failed to bind SPI port %d to the AT25 FLASH driver\n"); + ferr("ERROR: Failed to bind SPI port %d to AT25 FLASH driver\n"); return -ENODEV; } #if defined(CONFIG_SAMA5D3XPLAINED_AT25_FTL) - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ ret = ftl_initialize(AT25_MINOR, mtd); if (ret < 0) diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_bringup.c b/boards/arm/sama5/sama5d3-xplained/src/sam_bringup.c index 47013cc72f5..b1c7ea7d767 100644 --- a/boards/arm/sama5/sama5d3-xplained/src/sam_bringup.c +++ b/boards/arm/sama5/sama5d3-xplained/src/sam_bringup.c @@ -205,7 +205,7 @@ int sam_bringup(void) #ifdef CONFIG_SAMA5D4EK_HSMCI1_MOUNT else { - /* REVISIT: A delay seems to be required here or the mount will fail. */ + /* REVISIT: A delay seems to be required here or the mount will fail */ /* Mount the volume on HSMCI1 */ diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_nandflash.c b/boards/arm/sama5/sama5d3-xplained/src/sam_nandflash.c index 38e86cc32cc..aad48eb22ad 100644 --- a/boards/arm/sama5/sama5d3-xplained/src/sam_nandflash.c +++ b/boards/arm/sama5/sama5d3-xplained/src/sam_nandflash.c @@ -187,7 +187,8 @@ int sam_nand_automount(int minor) mtd = sam_nand_initialize(HSMC_CS3); if (!mtd) { - ferr("ERROR: Failed to create the NAND driver on CS%d\n", HSMC_CS3); + ferr("ERROR: Failed to create the NAND driver on CS%d\n", + HSMC_CS3); return -ENODEV; } @@ -220,6 +221,7 @@ int sam_nand_automount(int minor) return ret; } #endif + /* Now we are initialized */ initialized = true; diff --git a/boards/arm/sama5/sama5d3x-ek/src/sam_at24.c b/boards/arm/sama5/sama5d3x-ek/src/sam_at24.c index 7ad8e71613e..331b27bb5bb 100644 --- a/boards/arm/sama5/sama5d3x-ek/src/sam_at24.c +++ b/boards/arm/sama5/sama5d3x-ek/src/sam_at24.c @@ -35,8 +35,8 @@ /* AT24 Serial EEPROM * - * A AT24C512 Serial EEPPROM was used for tested I2C. There are other I2C/TWI - * devices on-board, but the serial EEPROM is the simplest test. + * A AT24C512 Serial EEPPROM was used for tested I2C. There are other + * I2C/TWI devices on-board, but the serial EEPROM is the simplest test. * * There is, however, no AT24 EEPROM on board the SAMA5D3x-EK: The Serial * EEPROM was mounted on an external adaptor board and connected to the @@ -121,7 +121,7 @@ int sam_at24_automount(int minor) } #if defined(CONFIG_SAMA5D3xEK_AT24_FTL) - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ finfo("Initialize the FTL layer to create /dev/mtdblock%d\n", AT24_MINOR); @@ -153,6 +153,7 @@ int sam_at24_automount(int minor) return ret; } #endif + /* Now we are initializeed */ initialized = true; diff --git a/boards/arm/sama5/sama5d3x-ek/src/sam_nandflash.c b/boards/arm/sama5/sama5d3x-ek/src/sam_nandflash.c index 52f4d0afd5b..a8874e9beb2 100644 --- a/boards/arm/sama5/sama5d3x-ek/src/sam_nandflash.c +++ b/boards/arm/sama5/sama5d3x-ek/src/sam_nandflash.c @@ -187,7 +187,8 @@ int sam_nand_automount(int minor) mtd = sam_nand_initialize(HSMC_CS3); if (!mtd) { - ferr("ERROR: Failed to create the NAND driver on CS%d\n", HSMC_CS3); + ferr("ERROR: Failed to create the NAND driver on CS%d\n", + HSMC_CS3); return -ENODEV; } @@ -220,6 +221,7 @@ int sam_nand_automount(int minor) return ret; } #endif + /* Now we are initialized */ initialized = true; diff --git a/boards/arm/sama5/sama5d4-ek/src/at25_main.c b/boards/arm/sama5/sama5d4-ek/src/at25_main.c index 10af0ec4c34..8ecee48c926 100644 --- a/boards/arm/sama5/sama5d4-ek/src/at25_main.c +++ b/boards/arm/sama5/sama5d4-ek/src/at25_main.c @@ -173,8 +173,8 @@ int at25_main(int argc, char *argv) fflush(stdout); ret = hex2bin(&rawinstream.public, &memoutstream.public, - (uint32_t)SAM_ISRAM_VSECTION, - (uint32_t)(SAM_ISRAM_VSECTION + CONFIG_SAMA5D4EK_AT25_PROGSIZE), + SAM_ISRAM_VSECTION, + SAM_ISRAM_VSECTION + CONFIG_SAMA5D4EK_AT25_PROGSIZE, 0); if (ret < 0) { diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_bringup.c b/boards/arm/sama5/sama5d4-ek/src/sam_bringup.c index f4ae399b512..2d32370ce5f 100644 --- a/boards/arm/sama5/sama5d4-ek/src/sam_bringup.c +++ b/boards/arm/sama5/sama5d4-ek/src/sam_bringup.c @@ -220,7 +220,7 @@ int sam_bringup(void) #ifdef CONFIG_SAMA5D4EK_HSMCI1_MOUNT else { - /* REVISIT: A delay seems to be required here or the mount will fail. */ + /* REVISIT: A delay seems to be required here or the mount will fail */ /* Mount the volume on HSMCI1 */ diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_nandflash.c b/boards/arm/sama5/sama5d4-ek/src/sam_nandflash.c index ccfa04cae38..8d1c99a519a 100644 --- a/boards/arm/sama5/sama5d4-ek/src/sam_nandflash.c +++ b/boards/arm/sama5/sama5d4-ek/src/sam_nandflash.c @@ -187,7 +187,8 @@ int sam_nand_automount(int minor) mtd = sam_nand_initialize(HSMC_CS3); if (!mtd) { - ferr("ERROR: Failed to create the NAND driver on CS%d\n", HSMC_CS3); + ferr("ERROR: Failed to create the NAND driver on CS%d\n", + HSMC_CS3); return -ENODEV; } @@ -220,6 +221,7 @@ int sam_nand_automount(int minor) return ret; } #endif + /* Now we are initialized */ initialized = true; diff --git a/boards/arm/samv7/same70-xplained/src/sam_bringup.c b/boards/arm/samv7/same70-xplained/src/sam_bringup.c index 4fd09de03ab..82858067930 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_bringup.c +++ b/boards/arm/samv7/same70-xplained/src/sam_bringup.c @@ -211,7 +211,7 @@ int sam_bringup(void) #ifdef CONFIG_SAME70XPLAINED_HSMCI0_MOUNT else { - /* REVISIT: A delay seems to be required here or the mount will fail. */ + /* REVISIT: A delay seems to be required here or the mount will fail */ /* Mount the volume on HSMCI0 */ @@ -239,8 +239,8 @@ int sam_bringup(void) #ifdef HAVE_ROMFS /* Create a ROM disk for the /etc filesystem */ - ret = romdisk_register(CONFIG_SAME70XPLAINED_ROMFS_ROMDISK_MINOR, romfs_img, - NSECTORS(romfs_img_len), + ret = romdisk_register(CONFIG_SAME70XPLAINED_ROMFS_ROMDISK_MINOR, + romfs_img, NSECTORS(romfs_img_len), CONFIG_SAME70XPLAINED_ROMFS_ROMDISK_SECTSIZE); if (ret < 0) { @@ -280,7 +280,8 @@ int sam_bringup(void) ret = ftl_initialize(PROGMEM_MTD_MINOR, mtd); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to initialize the FTL layer: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to initialize the FTL layer: %d\n", + ret); return ret; } @@ -294,7 +295,8 @@ int sam_bringup(void) ret = bchdev_register(blockdev, chardev, false); if (ret < 0) { - syslog(LOG_ERR, "ERROR: bchdev_register %s failed: %d\n", chardev, ret); + syslog(LOG_ERR, "ERROR: bchdev_register %s failed: %d\n", + chardev, ret); return ret; } #endif diff --git a/boards/arm/samv7/samv71-xult/src/sam_bringup.c b/boards/arm/samv7/samv71-xult/src/sam_bringup.c index 379be840078..67b60c6a466 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_bringup.c +++ b/boards/arm/samv7/samv71-xult/src/sam_bringup.c @@ -320,7 +320,7 @@ int sam_bringup(void) #ifdef CONFIG_SAMV71XULT_HSMCI0_MOUNT else { - /* REVISIT: A delay seems to be required here or the mount will fail. */ + /* REVISIT: A delay seems to be required here or the mount will fail */ /* Mount the volume on HSMCI0 */ diff --git a/boards/arm/stm32/clicker2-stm32/src/stm32_bringup.c b/boards/arm/stm32/clicker2-stm32/src/stm32_bringup.c index 36105abcc47..d861e031f7d 100644 --- a/boards/arm/stm32/clicker2-stm32/src/stm32_bringup.c +++ b/boards/arm/stm32/clicker2-stm32/src/stm32_bringup.c @@ -138,7 +138,8 @@ int stm32_bringup(void) ret = stm32_mrf24j40_initialize(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: stm32_mrf24j40_initialize() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: stm32_mrf24j40_initialize() failed: %d\n", + ret); } #endif @@ -159,7 +160,8 @@ int stm32_bringup(void) ret = stm32_automount_initialize(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: stm32_automount_initialize() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: stm32_automount_initialize() failed: %d\n", + ret); } #endif diff --git a/boards/arm/stm32/cloudctrl/src/stm32_w25.c b/boards/arm/stm32/cloudctrl/src/stm32_w25.c index 09c24b11c16..55d191b9550 100644 --- a/boards/arm/stm32/cloudctrl/src/stm32_w25.c +++ b/boards/arm/stm32/cloudctrl/src/stm32_w25.c @@ -60,6 +60,7 @@ ****************************************************************************/ /* Configuration ************************************************************/ + /* Can't support the W25 device if it SPI1 or W25 support is not enabled */ #define HAVE_W25 1 @@ -120,7 +121,7 @@ int stm32_w25initialize(int minor) } #ifndef CONFIG_FS_NXFFS - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ ret = ftl_initialize(minor, mtd); if (ret < 0) @@ -149,5 +150,6 @@ int stm32_w25initialize(int minor) } #endif #endif + return OK; } diff --git a/boards/arm/stm32/fire-stm32v2/src/stm32_w25.c b/boards/arm/stm32/fire-stm32v2/src/stm32_w25.c index 95e129d2133..5e4de80b856 100644 --- a/boards/arm/stm32/fire-stm32v2/src/stm32_w25.c +++ b/boards/arm/stm32/fire-stm32v2/src/stm32_w25.c @@ -59,6 +59,7 @@ ****************************************************************************/ /* Configuration ************************************************************/ + /* Can't support the W25 device if it SPI1 or W25 support is not enabled */ #define HAVE_W25 1 @@ -119,7 +120,7 @@ int stm32_w25initialize(int minor) } #ifndef CONFIG_FS_NXFFS - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ ret = ftl_initialize(minor, mtd); if (ret < 0) @@ -148,5 +149,6 @@ int stm32_w25initialize(int minor) } #endif #endif + return OK; } diff --git a/boards/arm/stm32/nucleo-f207zg/src/stm32_bringup.c b/boards/arm/stm32/nucleo-f207zg/src/stm32_bringup.c index 6f9fb84a0fd..1fdaa9f11e7 100644 --- a/boards/arm/stm32/nucleo-f207zg/src/stm32_bringup.c +++ b/boards/arm/stm32/nucleo-f207zg/src/stm32_bringup.c @@ -62,7 +62,8 @@ * CONFIG_BOARD_LATE_INITIALIZE=y : * Called from board_late_initialize(). * - * CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y && CONFIG_NSH_ARCHINIT: + * CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y && + * CONFIG_NSH_ARCHINIT: * Called from the NSH library * ****************************************************************************/ diff --git a/boards/arm/stm32/nucleo-f303ze/src/stm32_bringup.c b/boards/arm/stm32/nucleo-f303ze/src/stm32_bringup.c index 8b0d9db0d94..433bde8ede4 100644 --- a/boards/arm/stm32/nucleo-f303ze/src/stm32_bringup.c +++ b/boards/arm/stm32/nucleo-f303ze/src/stm32_bringup.c @@ -62,7 +62,8 @@ * CONFIG_BOARD_LATE_INITIALIZE=y : * Called from board_late_initialize(). * - * CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y && CONFIG_NSH_ARCHINIT: + * CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y && + * CONFIG_NSH_ARCHINIT: * Called from the NSH library * ****************************************************************************/ diff --git a/boards/arm/stm32/omnibusf4/src/stm32_bringup.c b/boards/arm/stm32/omnibusf4/src/stm32_bringup.c index e8ec765a9c1..8f125e4cc07 100644 --- a/boards/arm/stm32/omnibusf4/src/stm32_bringup.c +++ b/boards/arm/stm32/omnibusf4/src/stm32_bringup.c @@ -234,7 +234,6 @@ int stm32_bringup(void) } #endif - #ifdef CONFIG_USERLED /* Register the LED driver */ diff --git a/boards/arm/stm32/omnibusf4/src/stm32_romfs_initialize.c b/boards/arm/stm32/omnibusf4/src/stm32_romfs_initialize.c index 5c98f55315e..768702ba923 100644 --- a/boards/arm/stm32/omnibusf4/src/stm32_romfs_initialize.c +++ b/boards/arm/stm32/omnibusf4/src/stm32_romfs_initialize.c @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * boards/arm/stm32/omnibusf4/src/stm32_romfs_initialize.c * This file provides contents of an optional ROMFS volume, mounted at boot. * @@ -34,7 +34,7 @@ * ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Included Files ****************************************************************************/ diff --git a/boards/arm/stm32/shenzhou/src/stm32_w25.c b/boards/arm/stm32/shenzhou/src/stm32_w25.c index 846b5c75e91..a58c2e8f548 100644 --- a/boards/arm/stm32/shenzhou/src/stm32_w25.c +++ b/boards/arm/stm32/shenzhou/src/stm32_w25.c @@ -60,6 +60,7 @@ ****************************************************************************/ /* Configuration ************************************************************/ + /* Can't support the W25 device if it SPI1 or W25 support is not enabled */ #define HAVE_W25 1 @@ -120,7 +121,7 @@ int stm32_w25initialize(int minor) } #ifndef CONFIG_FS_NXFFS - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ ret = ftl_initialize(minor, mtd); if (ret < 0) @@ -149,5 +150,6 @@ int stm32_w25initialize(int minor) } #endif #endif + return OK; } diff --git a/boards/arm/stm32/stm3240g-eval/src/stm32_bringup.c b/boards/arm/stm32/stm3240g-eval/src/stm32_bringup.c index a721fe6960f..505714923a8 100644 --- a/boards/arm/stm32/stm3240g-eval/src/stm32_bringup.c +++ b/boards/arm/stm32/stm3240g-eval/src/stm32_bringup.c @@ -96,8 +96,8 @@ #define HAVE_USBHOST 1 #define HAVE_RTC_DRIVER 1 -/* Can't support MMC/SD features if mountpoints are disabled or if SDIO support - * is not enabled. +/* Can't support MMC/SD features if mountpoints are disabled or if SDIO + * support is not enabled. */ #if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_STM32_SDIO) @@ -287,7 +287,7 @@ int stm32_bringup(void) if (!mtd) { syslog(LOG_ERR, - "ERROR: Failed to bind SPI port 0 to the SPI FLASH driver\n"); + "ERROR: Failed to bind SPI port 0 to SPI FLASH driver\n"); } } @@ -296,6 +296,7 @@ int stm32_bringup(void) #ifdef HAVE_MMCSD /* Mount the SDIO-based MMC/SD block driver */ + /* First, get an instance of the SDIO interface */ sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_at24.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_at24.c index 6b8a7319c8d..061167c8078 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_at24.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_at24.c @@ -103,9 +103,10 @@ int stm32_at24_automount(int minor) } #if defined(CONFIG_STM32F103MINIMUM_AT24_FTL) - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ - finfo("Initialize the FTL layer to create /dev/mtdblock%d\n", AT24_MINOR); + finfo("Initialize the FTL layer to create /dev/mtdblock%d\n", + AT24_MINOR); ret = ftl_initialize(AT24_MINOR, mtd); if (ret < 0) { @@ -134,6 +135,7 @@ int stm32_at24_automount(int minor) return ret; } #endif + /* Now we are initialized */ initialized = true; diff --git a/boards/arm/stm32/stm32f103-minimum/src/stm32_w25.c b/boards/arm/stm32/stm32f103-minimum/src/stm32_w25.c index 173710cdc84..2ba174828f9 100644 --- a/boards/arm/stm32/stm32f103-minimum/src/stm32_w25.c +++ b/boards/arm/stm32/stm32f103-minimum/src/stm32_w25.c @@ -61,6 +61,7 @@ ****************************************************************************/ /* Debug ********************************************************************/ + /* Non-standard debug that may be enabled just for testing the watchdog * timer */ @@ -68,6 +69,7 @@ #define W25_SPI_PORT 1 /* Configuration ************************************************************/ + /* Can't support the W25 device if it SPI1 or W25 support is not enabled */ #define HAVE_W25 1 @@ -131,7 +133,7 @@ int stm32_w25initialize(int minor) } #ifndef CONFIG_FS_SMARTFS - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ ret = ftl_initialize(minor, mtd); if (ret < 0) @@ -152,122 +154,126 @@ int stm32_w25initialize(int minor) } #ifdef CONFIG_STM32F103MINIMUM_FLASH_PART - { - int partno; - int partsize; - int partoffset; - int partszbytes; - int erasesize; - const char *partstring = CONFIG_STM32F103MINIMUM_FLASH_PART_LIST; - const char *ptr; - FAR struct mtd_dev_s *mtd_part; - char partref[4]; + { + int partno; + int partsize; + int partoffset; + int partszbytes; + int erasesize; + const char *partstring = CONFIG_STM32F103MINIMUM_FLASH_PART_LIST; + const char *ptr; + FAR struct mtd_dev_s *mtd_part; + char partref[4]; - /* Now create a partition on the FLASH device */ + /* Now create a partition on the FLASH device */ - partno = 0; - ptr = partstring; - partoffset = 0; + partno = 0; + ptr = partstring; + partoffset = 0; - /* Get the Flash erase size */ + /* Get the Flash erase size */ - erasesize = geo.erasesize; + erasesize = geo.erasesize; - while (*ptr != '\0') - { - /* Get the partition size */ + while (*ptr != '\0') + { + /* Get the partition size */ - partsize = atoi(ptr); - partszbytes = (partsize << 10); /* partsize is defined in KB */ + partsize = atoi(ptr); + partszbytes = (partsize << 10); /* partsize is defined in KB */ - /* Check if partition size is bigger then erase block */ + /* Check if partition size is bigger then erase block */ - if (partszbytes < erasesize) - { - syslog(LOG_ERR, "ERROR: Partition size is lesser than erasesize!\n"); - return -1; - } + if (partszbytes < erasesize) + { + syslog(LOG_ERR, + "ERROR: Partition size is lesser than erasesize!\n"); + return -1; + } - /* Check if partition size is multiple of erase block */ + /* Check if partition size is multiple of erase block */ - if ( (partszbytes % erasesize) != 0 ) - { - syslog(LOG_ERR, "ERROR: Partition size is not multiple of erasesize!\n"); - return -1; - } + if ((partszbytes % erasesize) != 0) + { + syslog(LOG_ERR, + "ERROR: Partition size isn't multiple of erasesize!\n"); + return -1; + } - mtd_part = mtd_partition(mtd, partoffset, partszbytes/ erasesize); - partoffset += partszbytes / erasesize; + mtd_part = mtd_partition(mtd, partoffset, partszbytes / erasesize); + partoffset += partszbytes / erasesize; #ifdef CONFIG_STM32F103MINIMUM_FLASH_CONFIG_PART - /* Test if this is the config partition */ + /* Test if this is the config partition */ - if (CONFIG_STM32F103MINIMUM_FLASH_CONFIG_PART_NUMBER == partno) - { - /* Register the partition as the config device */ + if (CONFIG_STM32F103MINIMUM_FLASH_CONFIG_PART_NUMBER == partno) + { + /* Register the partition as the config device */ - mtdconfig_register(mtd_part); - } - else + mtdconfig_register(mtd_part); + } + else #endif - { - /* Now initialize a SMART Flash block device and bind it - * to the MTD device. - */ + { + /* Now initialize a SMART Flash block device and bind it + * to the MTD device. + */ #if defined(CONFIG_MTD_SMART) && defined(CONFIG_FS_SMARTFS) - sprintf(partref, "p%d", partno); - smart_initialize(CONFIG_STM32F103MINIMUM_FLASH_MINOR, mtd_part, partref); + sprintf(partref, "p%d", partno); + smart_initialize(CONFIG_STM32F103MINIMUM_FLASH_MINOR, + mtd_part, partref); #endif - } + } - /* Set the partition name */ + /* Set the partition name */ #if defined(CONFIG_MTD_PARTITION_NAMES) - if (!mtd_part) - { - syslog(LOG_ERR, "Error: failed to create partition %s\n", partname); - return -1; - } + if (!mtd_part) + { + syslog(LOG_ERR, "Error: failed to create partition %s\n", + partname); + return -1; + } - mtd_setpartitionname(mtd_part, partname); + mtd_setpartitionname(mtd_part, partname); - /* Now skip to next name. We don't need to split the string here - * because the MTD partition logic will only display names up to - * the comma, thus allowing us to use a single static name - * in the code. - */ + /* Now skip to next name. We don't need to split the string here + * because the MTD partition logic will only display names up to + * the comma, thus allowing us to use a single static name + * in the code. + */ - while (*partname != ',' && *partname != '\0') - { - /* Skip to next ',' */ + while (*partname != ',' && *partname != '\0') + { + /* Skip to next ',' */ - partname++; - } + partname++; + } - if (*partname == ',') - { - partname++; - } + if (*partname == ',') + { + partname++; + } #endif - /* Update the pointer to point to the next size in the list */ + /* Update the pointer to point to the next size in the list */ - while ((*ptr >= '0') && (*ptr <= '9')) - { - ptr++; - } + while ((*ptr >= '0') && (*ptr <= '9')) + { + ptr++; + } - if (*ptr == ',') - { - ptr++; - } + if (*ptr == ',') + { + ptr++; + } - /* Increment the part number */ + /* Increment the part number */ - partno++; - } - } + partno++; + } + } #else /* CONFIG_STM32F103MINIMUM_FLASH_PART */ /* Configure the device with no partition support */ diff --git a/boards/arm/stm32/stm32f411e-disco/src/stm32_bringup.c b/boards/arm/stm32/stm32f411e-disco/src/stm32_bringup.c index 60a2cf5636a..a08c1e793aa 100644 --- a/boards/arm/stm32/stm32f411e-disco/src/stm32_bringup.c +++ b/boards/arm/stm32/stm32f411e-disco/src/stm32_bringup.c @@ -74,8 +74,8 @@ int stm32_bringup(void) int ret = OK; #if defined(CONFIG_STM32_OTGFS) && defined(CONFIG_USBHOST) - /* Initialize USB host operation. stm32_usbhost_initialize() starts a thread - * will monitor for USB connection and disconnection events. + /* Initialize USB host operation. stm32_usbhost_initialize() starts + * a thread will monitor for USB connection and disconnection events. */ ret = stm32_usbhost_initialize(); diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_romfs_initialize.c b/boards/arm/stm32/stm32f4discovery/src/stm32_romfs_initialize.c index bfb925ec598..0e2c5e46da9 100644 --- a/boards/arm/stm32/stm32f4discovery/src/stm32_romfs_initialize.c +++ b/boards/arm/stm32/stm32f4discovery/src/stm32_romfs_initialize.c @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * boards/arm/stm32/stm32f4discovery/src/stm32_romfs_initialize.c * This file provides contents of an optional ROMFS volume, mounted at boot. * @@ -34,7 +34,7 @@ * ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Included Files ****************************************************************************/ diff --git a/boards/arm/stm32f0l0g0/nucleo-f091rc/src/stm32_bringup.c b/boards/arm/stm32f0l0g0/nucleo-f091rc/src/stm32_bringup.c index 741378e0810..985a6dc40c6 100644 --- a/boards/arm/stm32f0l0g0/nucleo-f091rc/src/stm32_bringup.c +++ b/boards/arm/stm32f0l0g0/nucleo-f091rc/src/stm32_bringup.c @@ -82,7 +82,8 @@ int stm32_bringup(void) ret = stm32_lpwaninitialize(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to initialize wireless driver: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to initialize wireless driver: %d\n", + ret); } #endif /* CONFIG_LPWAN_SX127X */ diff --git a/boards/arm/stm32f7/nucleo-144/src/stm32_romfs_initialize.c b/boards/arm/stm32f7/nucleo-144/src/stm32_romfs_initialize.c index 68e9ce21c70..9a8302c56a5 100644 --- a/boards/arm/stm32f7/nucleo-144/src/stm32_romfs_initialize.c +++ b/boards/arm/stm32f7/nucleo-144/src/stm32_romfs_initialize.c @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * boards/arm/stm32f7/nucleo-144/src/stm32_romfs_initialize.c * This file provides contents of an optional ROMFS volume, mounted at boot. * @@ -34,7 +34,7 @@ * ****************************************************************************/ -/***************************************************************************** +/**************************************************************************** * Included Files ****************************************************************************/ diff --git a/boards/arm/stm32l4/b-l475e-iot01a/src/stm32_bringup.c b/boards/arm/stm32l4/b-l475e-iot01a/src/stm32_bringup.c index d2fe1bce496..a6cb501be60 100644 --- a/boards/arm/stm32l4/b-l475e-iot01a/src/stm32_bringup.c +++ b/boards/arm/stm32l4/b-l475e-iot01a/src/stm32_bringup.c @@ -65,10 +65,10 @@ * Name: stm32l4_bringup * * Description: - * Called either by board_initialize() if CONFIG_BOARD_LATE_INITIALIZE or by - * board_app_initialize if CONFIG_LIB_BOARDCTL is selected. This function - * initializes and configures all on-board features appropriate for the - * selected configuration. + * Called either by board_initialize() if CONFIG_BOARD_LATE_INITIALIZE or + * by board_app_initialize if CONFIG_LIB_BOARDCTL is selected. This + * function initializes and configures all on-board features appropriate + * for the selected configuration. * ****************************************************************************/ @@ -104,131 +104,134 @@ int stm32l4_bringup(void) #endif /* CONFIG_USERLED && !CONFIG_ARCH_LEDS */ #ifdef HAVE_MX25R6435F - { - /* Create an instance of the STM32L4 QSPI device driver */ + { + /* Create an instance of the STM32L4 QSPI device driver */ - FAR struct qspi_dev_s *g_qspi; - FAR struct mtd_dev_s *g_mtd_fs; + FAR struct qspi_dev_s *g_qspi; + FAR struct mtd_dev_s *g_mtd_fs; - g_qspi = stm32l4_qspi_initialize(0); - if (g_qspi == NULL) - { - syslog(LOG_ERR, "ERROR: stm32l4_qspi_initialize failed\n"); - return -EIO; - } + g_qspi = stm32l4_qspi_initialize(0); + if (g_qspi == NULL) + { + syslog(LOG_ERR, "ERROR: stm32l4_qspi_initialize failed\n"); + return -EIO; + } - /* Use the QSPI device instance to initialize the - * MX25R6435F flash device. - */ + /* Use the QSPI device instance to initialize the + * MX25R6435F flash device. + */ - g_mtd_fs = mx25rxx_initialize(g_qspi, true); - if (!g_mtd_fs) - { - syslog(LOG_ERR, "ERROR: mx25rxx_initialize failed\n"); - return -EIO; - } + g_mtd_fs = mx25rxx_initialize(g_qspi, true); + if (!g_mtd_fs) + { + syslog(LOG_ERR, "ERROR: mx25rxx_initialize failed\n"); + return -EIO; + } #ifdef CONFIG_B_L475E_IOT01A_MTD_PART - { - /* Create partitions on external flash memory */ + { + /* Create partitions on external flash memory */ - int partno; - int partsize; - int partoffset; - int partszbytes; - int erasesize; - FAR struct mtd_geometry_s geo; - const char *ptr = CONFIG_B_L475E_IOT01A_MTD_PART_LIST; - FAR struct mtd_dev_s *mtd_part; - char partref[4]; + int partno; + int partsize; + int partoffset; + int partszbytes; + int erasesize; + FAR struct mtd_geometry_s geo; + const char *ptr = CONFIG_B_L475E_IOT01A_MTD_PART_LIST; + FAR struct mtd_dev_s *mtd_part; + char partref[4]; - /* Now create a partition on the FLASH device */ + /* Now create a partition on the FLASH device */ - partno = 0; - partoffset = 0; + partno = 0; + partoffset = 0; - /* Query MTD geometry */ + /* Query MTD geometry */ - ret = MTD_IOCTL(g_mtd_fs, MTDIOC_GEOMETRY, - (unsigned long)(uintptr_t)&geo); - if (ret < 0) - { - syslog(LOG_ERR, "ERROR: MTDIOC_GEOMETRY failed\n"); - return ret; - } + ret = MTD_IOCTL(g_mtd_fs, MTDIOC_GEOMETRY, + (unsigned long)(uintptr_t)&geo); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: MTDIOC_GEOMETRY failed\n"); + return ret; + } - /* Get the Flash erase size */ + /* Get the Flash erase size */ - erasesize = geo.erasesize; + erasesize = geo.erasesize; - while (*ptr != '\0') - { - /* Get the partition size */ + while (*ptr != '\0') + { + /* Get the partition size */ - partsize = atoi(ptr); - if (partsize <= 0) - { - syslog(LOG_ERR, "Error while processing <%s>\n", ptr); - goto process_next_part; - } + partsize = atoi(ptr); + if (partsize <= 0) + { + syslog(LOG_ERR, "Error while processing <%s>\n", ptr); + goto process_next_part; + } - partszbytes = (partsize << 10); /* partsize is defined in KB */ + partszbytes = (partsize << 10); /* partsize is defined in KB */ - if ((partszbytes < erasesize) || ((partszbytes % erasesize) != 0)) - { - syslog(LOG_ERR, "Invalid partition size: %d bytes\n", - partszbytes); - partszbytes = (partszbytes+erasesize) & -erasesize; - } + if (partszbytes < erasesize || (partszbytes % erasesize) != 0) + { + syslog(LOG_ERR, "Invalid partition size: %d bytes\n", + partszbytes); + partszbytes = (partszbytes + erasesize) & -erasesize; + } - mtd_part = mtd_partition(g_mtd_fs, partoffset, - partszbytes / geo.blocksize); - partoffset += partszbytes / geo.blocksize; + mtd_part = mtd_partition(g_mtd_fs, partoffset, + partszbytes / geo.blocksize); + partoffset += partszbytes / geo.blocksize; - if (!mtd_part) - { - syslog(LOG_ERR, "Failed to create part %d, size=%d\n", - partno, partsize); - goto process_next_part; - } + if (!mtd_part) + { + syslog(LOG_ERR, "Failed to create part %d, size=%d\n", + partno, partsize); + goto process_next_part; + } #if defined(CONFIG_MTD_SMART) && defined(CONFIG_FS_SMARTFS) - /* Now initialize a SMART Flash block device and bind it to the MTD - * device */ + /* Now initialize a SMART Flash block device and bind it to + * the MTD device + */ - sprintf(partref, "p%d", partno); - smart_initialize(CONFIG_B_L475E_IOT01A_MTD_FLASH_MINOR, - mtd_part, partref); + sprintf(partref, "p%d", partno); + smart_initialize(CONFIG_B_L475E_IOT01A_MTD_FLASH_MINOR, + mtd_part, partref); #endif -process_next_part: - /* Update the pointer to point to the next size in the list */ + process_next_part: - while ((*ptr >= '0') && (*ptr <= '9')) - { - ptr++; - } + /* Update the pointer to point to the next size in the list */ - if (*ptr == ',') - { - ptr++; - } + while ((*ptr >= '0') && (*ptr <= '9')) + { + ptr++; + } - /* Increment the part number */ + if (*ptr == ',') + { + ptr++; + } - partno++; - } - } + /* Increment the part number */ + + partno++; + } + } #else /* CONFIG_B_L475E_IOT01A_MTD_PART */ #ifdef HAVE_MX25R6435F_SMARTFS /* Configure the device with no partition support */ - smart_initialize(CONFIG_B_L475E_IOT01A_MTD_FLASH_MINOR, g_mtd_fs, NULL); + smart_initialize(CONFIG_B_L475E_IOT01A_MTD_FLASH_MINOR, + g_mtd_fs, NULL); #endif /* HAVE_MX25R6435F_SMARTFS */ #endif /* CONFIG_B_L475E_IOT01A_MTD_PART */ - } + } #endif /* HAVE_MX25R6435F */ #ifdef HAVE_SPSGRF @@ -237,17 +240,19 @@ process_next_part: ret = stm32l4_spirit_initialize(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: stm32l4_spirit_initialize() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: stm32l4_spirit_initialize() failed: %d\n", + ret); } #endif #ifdef CONFIG_TIMER -/* Register timer drivers */ + /* Register timer drivers */ ret = stm32l4_timer_driver_setup(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to setup TIM1 at /dev/timer0: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to setup TIM1 at /dev/timer0: %d\n", + ret); } #endif diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_at45db.c b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_at45db.c index 45d6da6f9ed..e303e804e2f 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_at45db.c +++ b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_at45db.c @@ -1,4 +1,4 @@ -/******************************************************************************* +/**************************************************************************** * boards/arm/stm32l4/nucleo-l432kc/src/stm32_at45.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - ******************************************************************************/ + ****************************************************************************/ #include @@ -51,31 +51,31 @@ #include "stm32l4_spi.h" -/******************************************************************************* +/**************************************************************************** * Pre-processor Definitions - ******************************************************************************/ + ****************************************************************************/ #ifndef CONFIG_STM32L4_SPI1 # error "AT45DB driver requires CONFIG_STM32_SPI1 to be enabled" #endif -/******************************************************************************* -* Private Definitions -******************************************************************************/ +/**************************************************************************** + * Private Definitions + ****************************************************************************/ static const int AT45DB_SPI_PORT = 1; /* AT45DB is connected to SPI1 port */ -/******************************************************************************* +/**************************************************************************** * Public Functions - ******************************************************************************/ + ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Name: stm32_at45dbinitialize * * Description: * Initialize and configure the AT45DB SPI Serial Flash Memory * - ******************************************************************************/ + ****************************************************************************/ int stm32_at45dbinitialize(int minor) { diff --git a/boards/arm/stm32l4/nucleo-l452re/src/stm32_adc.c b/boards/arm/stm32l4/nucleo-l452re/src/stm32_adc.c index 36f7c30f9c5..8b51f13fe5e 100644 --- a/boards/arm/stm32l4/nucleo-l452re/src/stm32_adc.c +++ b/boards/arm/stm32l4/nucleo-l452re/src/stm32_adc.c @@ -77,7 +77,7 @@ #endif /* Internal reference voltage calibration value locations. Taken from - * https://github.com/micropython/micropython/commit/87215a0f0480dd0324a1b9c1d3fc3a5c2806249d + * https://github.com/micropython/micropython/commit/87215a0f0480dd0324a1b9c1 * * F0 value from DM00115237 Rev 4 p. 19. for STM32F091xB and STM32F091xC * diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_appinit.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_appinit.c index 3ab5e72f691..d2860c6e897 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_appinit.c +++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_appinit.c @@ -68,7 +68,7 @@ /**************************************************************************** * Private Data - ***************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Public Functions @@ -98,19 +98,19 @@ static void stm32_i2c_register(int bus) i2c = stm32l4_i2cbus_initialize(bus); if (i2c == NULL) - { - syslog(LOG_ERR, "ERROR: Failed to get I2C%d interface\n", bus); - } - else - { - ret = i2c_register(i2c, bus); - if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to register I2C%d driver: %d\n", - bus, ret); - stm32l4_i2cbus_uninitialize(i2c); + syslog(LOG_ERR, "ERROR: Failed to get I2C%d interface\n", bus); + } + else + { + ret = i2c_register(i2c, bus); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to register I2C%d driver: %d\n", + bus, ret); + stm32l4_i2cbus_uninitialize(i2c); + } } - } } #endif @@ -292,7 +292,7 @@ int board_app_initialize(uintptr_t arg) } #endif -/* Initialize MMC and register the MMC driver. */ + /* Initialize MMC and register the MMC driver. */ #ifdef HAVE_MMCSD_SPI ret = stm32l4_mmcsd_initialize(MMCSD_MINOR); diff --git a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_appinitialize.c b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_appinitialize.c index bfa33424ce1..fcc2cbe83a0 100644 --- a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_appinitialize.c +++ b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_appinitialize.c @@ -53,19 +53,19 @@ /**************************************************************************** * Private Data - ***************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_STM32L4_I2C1) -struct i2c_master_s* i2c1; +struct i2c_master_s *i2c1; #endif #if defined(CONFIG_STM32L4_I2C2) -struct i2c_master_s* i2c2; +struct i2c_master_s *i2c2; #endif #if defined(CONFIG_STM32L4_I2C3) -struct i2c_master_s* i2c3; +struct i2c_master_s *i2c3; #endif #if defined(CONFIG_STM32L4_I2C4) -struct i2c_master_s* i2c4; +struct i2c_master_s *i2c4; #endif /**************************************************************************** @@ -166,7 +166,8 @@ int board_app_initialize(uintptr_t arg) ret = stm32_spidev_bus_test(); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to initialize SPI interfaces: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to initialize SPI interfaces: %d\n", + ret); return ret; } #endif diff --git a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_adc.c b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_adc.c index 17e74e2a60f..51c700aced4 100644 --- a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_adc.c +++ b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_adc.c @@ -1,4 +1,4 @@ -/***************************************************************************** +/**************************************************************************** * boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_adc.c * * Copyright (C) 2017-2018 Haltian Ltd. All rights reserved. @@ -61,9 +61,9 @@ * Pre-processor Definitions ****************************************************************************/ -/* STM32 chip specific calibration values *******************************************/ +/* STM32 chip specific calibration values ***********************************/ -/* Voltage used for calibration of internal analog reference voltage (Vrefint) */ +/* Voltage used for calibration of internal analog reference voltage */ #if defined(CONFIG_ARCH_CHIP_STM32F7) \ || defined(CONFIG_ARCH_CHIP_STM32F4) \ @@ -74,7 +74,7 @@ #endif /* Internal reference voltage calibration value locations. Taken from - * https://github.com/micropython/micropython/commit/87215a0f0480dd0324a1b9c1d3fc3a5c2806249d + * https://github.com/micropython/micropython/commit/87215a0f0480dd0324a1b9c1 * * F0 value from DM00115237 Rev 4 p. 19. for STM32F091xB and STM32F091xC * @@ -110,7 +110,7 @@ # define STM32_TSENSE_TSCAL2 (*(int16_t *)((uint32_t)0x1fff75ca)) #endif -/* Configuration ********************************************************************/ +/* Configuration ************************************************************/ /* These are internal to STM32L4 */ @@ -146,9 +146,9 @@ static const uint8_t g_chanlist[ADC1_NCHANNELS] = static const uint32_t g_pinlist[ADC1_NCHANNELS] = { - 0xffffffffU, - 0xffffffffU, - 0xffffffffU, + 0xffffffffu, + 0xffffffffu, + 0xffffffffu, GPIO_MEASURE_ADC, }; @@ -164,9 +164,10 @@ static const uint32_t g_pinlist[ADC1_NCHANNELS] = * ****************************************************************************/ -int stm32l4_adc_measure_voltages(uint32_t *vrefint, uint32_t *vbat, uint32_t *vext) +int stm32l4_adc_measure_voltages(uint32_t *vrefint, uint32_t *vbat, + uint32_t *vext) { - struct adc_msg_s sample[ADC1_NCHANNELS] = { 0 }; + struct adc_msg_s sample[ADC1_NCHANNELS]; FAR struct file filestruct; ssize_t nbytes; int nsamples; @@ -223,7 +224,7 @@ int stm32l4_adc_measure_voltages(uint32_t *vrefint, uint32_t *vbat, uint32_t *ve for (i = 0; i < nsamples ; i++) { ainfo("%d: channel: %d value: %d\n", - i+1, sample[i].am_channel, sample[i].am_data); + i + 1, sample[i].am_channel, sample[i].am_data); /* Add the raw value to entropy pool. */ @@ -232,9 +233,11 @@ int stm32l4_adc_measure_voltages(uint32_t *vrefint, uint32_t *vbat, uint32_t *ve switch (sample[i].am_channel) { case ADC1_INTERNAL_VREFINT_CHANNEL: - /* Calculate corrected Vrefint with factory calibration value. */ - *vrefint = STM32_VREFINT_MVOLTS * STM32_VREFINT_CAL / sample[i].am_data; + /* Calculate corrected Vrefint with factory value. */ + + *vrefint = STM32_VREFINT_MVOLTS * STM32_VREFINT_CAL / + sample[i].am_data; ainfo("VREFINT: %d -> %u mV\n", sample[i].am_data, *vrefint); break; @@ -243,8 +246,9 @@ int stm32l4_adc_measure_voltages(uint32_t *vrefint, uint32_t *vbat, uint32_t *ve * so it does not matter much if we use integer type here. */ - tsense = (110 - 30) * (sample[i].am_data - STM32_TSENSE_TSCAL1) - / (STM32_TSENSE_TSCAL2 - STM32_TSENSE_TSCAL1) + 30; + tsense = 30 + (110 - 30) * + (sample[i].am_data - STM32_TSENSE_TSCAL1) / + (STM32_TSENSE_TSCAL2 - STM32_TSENSE_TSCAL1); ainfo("TSENSE: %d -> %d °C\n", sample[i].am_data, tsense); UNUSED(tsense); break; @@ -260,7 +264,8 @@ int stm32l4_adc_measure_voltages(uint32_t *vrefint, uint32_t *vbat, uint32_t *ve break; default: - aerr("ERROR: ADC got value from unknown channel %d\n", sample[i].am_channel); + aerr("ERROR: ADC got value from unknown channel %d\n", + sample[i].am_channel); break; } } @@ -283,19 +288,20 @@ int stm32l4_adc_setup(void) if (!initialized) { #ifdef CONFIG_STM32L4_ADC1 - int ret, i; + int ret; + int i; /* Configure the pins as analog inputs for the selected channels */ for (i = 0; i < ADC1_NCHANNELS; i++) { - if (g_pinlist[i] != 0xffffffffU) + if (g_pinlist[i] != 0xffffffffu) { stm32l4_configgpio(g_pinlist[i]); } } - /* Call stm32l4_adc_initialize() to get an instance of the ADC interface */ + /* Call stm32l4_adc_initialize() to get an instance of the ADC */ g_adc = stm32l4_adc_initialize(1, g_chanlist, ADC1_NCHANNELS); if (g_adc == NULL) @@ -313,6 +319,7 @@ int stm32l4_adc_setup(void) return ret; } #endif + initialized = true; } diff --git a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_appinit.c b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_appinit.c index 56d93a7b444..bb1b9a69b92 100644 --- a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_appinit.c +++ b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_appinit.c @@ -64,9 +64,9 @@ #include "stm32l4r9ai-disco.h" -/* Conditional logic in stm32l4r9ai-disco.h will determine if certain features - * are supported. Tests for these features need to be made after including - * stm32l4r9ai-disco. +/* Conditional logic in stm32l4r9ai-disco.h will determine if certain + * features are supported. Tests for these features need to be made + * after includingstm32l4r9ai-disco. */ #ifdef HAVE_RTC_DRIVER @@ -80,10 +80,10 @@ #ifdef CONFIG_I2C # ifdef CONFIG_STM32L4_I2C1 -static struct i2c_master_s* g_i2c1; +static struct i2c_master_s *g_i2c1; # endif # ifdef CONFIG_STM32L4_I2C3 -static struct i2c_master_s* g_i2c3; +static struct i2c_master_s *g_i2c3; # endif #endif diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_bringup.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_bringup.c index 3b3e7f480f1..3cf103f13d9 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_bringup.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_bringup.c @@ -60,8 +60,8 @@ * Description: * Bring up board features. * - * If CONFIG_BOARD_LATE_INITIALIZE=y, then this function will be called from - * board_late_initialize(). + * If CONFIG_BOARD_LATE_INITIALIZE=y, then this function will be called + * from board_late_initialize(). * * If CONFIG_BOARD_LATE_INITIALIZE is not selected, * but CONFIG_LIB_BOARDCTL=y diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_bringup.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_bringup.c index 497798b1a95..606eac965f5 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_bringup.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_bringup.c @@ -60,8 +60,8 @@ * Description: * Bring up board features. * - * If CONFIG_BOARD_LATE_INITIALIZE=y, then this function will be called from - * board_late_initialize(). + * If CONFIG_BOARD_LATE_INITIALIZE=y, then this function will be called + * from board_late_initialize(). * * If CONFIG_BOARD_LATE_INITIALIZE is not selected, * but CONFIG_LIB_BOARDCTL=y diff --git a/boards/arm/tiva/lm3s6965-ek/src/lm_bringup.c b/boards/arm/tiva/lm3s6965-ek/src/lm_bringup.c index ead4a833b1a..b762cdd02d2 100644 --- a/boards/arm/tiva/lm3s6965-ek/src/lm_bringup.c +++ b/boards/arm/tiva/lm3s6965-ek/src/lm_bringup.c @@ -108,7 +108,8 @@ int lm_bringup(void) return -ENODEV; } - mcinfo("Successfully initialized SPI port %d\n", CONFIG_NSH_MMCSDSPIPORTNO); + mcinfo("Successfully initialized SPI port %d\n", + CONFIG_NSH_MMCSDSPIPORTNO); /* Bind the SPI port to the slot */ diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_at24.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_at24.c index 0f06feb6ee7..462816c9e57 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_at24.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_at24.c @@ -117,9 +117,7 @@ int tm4c_at24_automount(int minor) } #if defined(CONFIG_TM4C123G_LAUNCHPAD_AT24_FTL) - /* And finally, - * use the FTL layer to wrap the MTD driver as a block driver - */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ ret = ftl_initialize(AT24_MINOR, mtd); if (ret < 0) @@ -149,6 +147,7 @@ int tm4c_at24_automount(int minor) return ret; } #endif + /* Now we are initialized */ initialized = true; diff --git a/boards/mips/pic32mx/mirtoo/src/pic32_appinit.c b/boards/mips/pic32mx/mirtoo/src/pic32_appinit.c index 23540c3056d..77afa32a184 100644 --- a/boards/mips/pic32mx/mirtoo/src/pic32_appinit.c +++ b/boards/mips/pic32mx/mirtoo/src/pic32_appinit.c @@ -61,7 +61,7 @@ /* Configuration ************************************************************/ -/* Can't support the SST25 device if it SPI2 or SST25 support is not enabled */ +/* Can't support the SST25 device if it SPI2/SST25 support is not enabled */ #define HAVE_SST25 1 #if !defined(CONFIG_PIC32MX_SPI2) || !defined(CONFIG_MTD_SST25) @@ -139,7 +139,7 @@ int board_app_initialize(uintptr_t arg) } #ifndef CONFIG_FS_NXFFS - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And use the FTL layer to wrap the MTD driver as a block driver */ ret = ftl_initialize(CONFIG_NSH_MMCSDMINOR, mtd); if (ret < 0) @@ -167,5 +167,6 @@ int board_app_initialize(uintptr_t arg) } #endif #endif + return OK; } diff --git a/drivers/lcd/ili9340.c b/drivers/lcd/ili9340.c index 24e462fd3fa..3a5a3c682d8 100644 --- a/drivers/lcd/ili9340.c +++ b/drivers/lcd/ili9340.c @@ -1133,8 +1133,8 @@ static int ili9340_setcontrast(struct lcd_dev_s *dev, unsigned int contrast) * * Returned Value: * - * On success, this function returns a reference to the LCD driver object for - * the specified LCD driver. NULL is returned on any failure. + * On success, this function returns a reference to the LCD driver object + * for the specified LCD driver. NULL is returned on any failure. * ****************************************************************************/ @@ -1181,9 +1181,9 @@ FAR struct lcd_dev_s *ili9340_initialize( * * Description: * This is a non-standard LCD interface. Because of the various rotations, - * clearing the display in the normal way by writing a sequences of runs that - * covers the entire display can be very slow. Here the display is cleared by - * simply setting all GRAM memory to the specified color. + * clearing the display in the normal way by writing a sequences of runs + * that covers the entire display can be very slow. Here the display is + * cleared by simply setting all GRAM memory to the specified color. * * Parameter: * dev - A reference to the lcd driver structure diff --git a/libs/libc/grp/lib_find_grpfile.c b/libs/libc/grp/lib_find_grpfile.c index 6f9886ef5f7..60d3e483b84 100644 --- a/libs/libc/grp/lib_find_grpfile.c +++ b/libs/libc/grp/lib_find_grpfile.c @@ -312,7 +312,8 @@ static int grp_foreach(grp_foreach_match_t match, uintptr_t arg, int grp_findby_name(FAR const char *gname, FAR struct group *entry, FAR char *buffer, size_t buflen) { - return grp_foreach(grp_match_name, (uintptr_t)gname, entry, buffer, buflen); + return grp_foreach(grp_match_name, (uintptr_t)gname, + entry, buffer, buflen); } /**************************************************************************** diff --git a/libs/libc/misc/lib_sendfile.c b/libs/libc/misc/lib_sendfile.c index dd333559b54..ad0f9f5159e 100644 --- a/libs/libc/misc/lib_sendfile.c +++ b/libs/libc/misc/lib_sendfile.c @@ -217,15 +217,17 @@ ssize_t sendfile(int outfd, int infd, off_t *offset, size_t count) if (nbyteswritten >= 0) { - /* Advance the buffer pointer and decrement the number of bytes - * remaining in the iobuffer. Typically, nbytesread will now - * be zero. + /* Advance the buffer pointer and decrement the number of + * bytes remaining in the iobuffer. Typically, nbytesread + * will now be zero. */ wrbuffer += nbyteswritten; nbytesread -= nbyteswritten; - /* Increment the total number of bytes successfully transferred. */ + /* Increment the total number of bytes successfully + * transferred. + */ ntransferred += nbyteswritten; } diff --git a/libs/libc/pwd/lib_find_pwdfile.c b/libs/libc/pwd/lib_find_pwdfile.c index f9f109b6502..dcd5152886a 100644 --- a/libs/libc/pwd/lib_find_pwdfile.c +++ b/libs/libc/pwd/lib_find_pwdfile.c @@ -289,7 +289,8 @@ static int pwd_foreach(pwd_foreach_match_t match, uintptr_t arg, int pwd_findby_name(FAR const char *uname, FAR struct passwd *entry, FAR char *buffer, size_t buflen) { - return pwd_foreach(pwd_match_name, (uintptr_t)uname, entry, buffer, buflen); + return pwd_foreach(pwd_match_name, (uintptr_t)uname, + entry, buffer, buflen); } /**************************************************************************** diff --git a/libs/libc/stdio/lib_libfwrite.c b/libs/libc/stdio/lib_libfwrite.c index 220a27453be..93ec54e4a16 100644 --- a/libs/libc/stdio/lib_libfwrite.c +++ b/libs/libc/stdio/lib_libfwrite.c @@ -1,7 +1,8 @@ /**************************************************************************** * libs/libc/stdio/lib_libfwrite.c * - * Copyright (C) 2007-2009, 2011, 2013-2014, 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011, 2013-2014, 2017 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -85,18 +86,18 @@ ssize_t lib_fwrite(FAR const void *ptr, size_t count, FAR FILE *stream) /* If there is no I/O buffer, then output data immediately */ if (stream->fs_bufstart == NULL) - { - ret = _NX_WRITE(stream->fs_fd, ptr, count); + { + ret = _NX_WRITE(stream->fs_fd, ptr, count); #if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__) - if (ret < 0) - { - _NX_SETERRNO(ret); - ret = ERROR; - } + if (ret < 0) + { + _NX_SETERRNO(ret); + ret = ERROR; + } #endif - goto errout; - } + goto errout; + } /* Get exclusive access to the stream */ diff --git a/libs/libc/stdio/lib_perror.c b/libs/libc/stdio/lib_perror.c index c37fb757b03..354e2c583a7 100644 --- a/libs/libc/stdio/lib_perror.c +++ b/libs/libc/stdio/lib_perror.c @@ -68,7 +68,6 @@ void perror(FAR const char *s) { - /* If strerror() is not enabled, then just print the error number */ #ifdef CONFIG_LIBC_STRERROR