From 5de416e8faff727c3b39cf0a2653ffc17c72e0d2 Mon Sep 17 00:00:00 2001 From: Mathias Brossard Date: Thu, 8 Aug 2019 20:47:50 -0500 Subject: [PATCH 1/3] Fix inline keyword place --- target/TARGET_NXP/fsl_sd.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/TARGET_NXP/fsl_sd.c b/target/TARGET_NXP/fsl_sd.c index 0cbb8b7..7f5d00a 100644 --- a/target/TARGET_NXP/fsl_sd.c +++ b/target/TARGET_NXP/fsl_sd.c @@ -38,7 +38,7 @@ static status_t SD_SendWriteSuccessBlocks(sd_card_t *card, uint32_t *blocks); * @retval kStatus_SDMMC_CardNotSupport Card doesn't support. * @retval kStatus_Success Operate successfully. */ -static status_t inline SD_SendApplicationCmd(sd_card_t *card, uint32_t relativeAddress); +static inline status_t SD_SendApplicationCmd(sd_card_t *card, uint32_t relativeAddress); /*! * @brief Send GO_IDLE command to set the card to be idle state. @@ -47,7 +47,7 @@ static status_t inline SD_SendApplicationCmd(sd_card_t *card, uint32_t relativeA * @retval kStatus_SDMMC_TransferFailed Transfer failed. * @retval kStatus_Success Operate successfully. */ -static status_t inline SD_GoIdle(sd_card_t *card); +static inline status_t SD_GoIdle(sd_card_t *card); /*! * @brief Send STOP_TRANSMISSION command after multiple blocks read/write. @@ -66,7 +66,7 @@ static status_t SD_StopTransmission(sd_card_t *card); * @retval kStatus_SDMMC_TransferFailed Transfer failed. * @retval kStatus_Success Operate successfully. */ -static status_t inline SD_SetBlockSize(sd_card_t *card, uint32_t blockSize); +static inline status_t SD_SetBlockSize(sd_card_t *card, uint32_t blockSize); /*! * @brief Send GET_RCA command to get card relative address. @@ -288,7 +288,7 @@ static status_t SD_Transfer(sd_card_t *card, SDMMCHOST_TRANSFER *content, uint32 * @retval kStatus_SDMMC_TuningFail tuning fail. * @retval kStatus_SDMMC_TransferFailed transfer fail */ -static status_t inline SD_ExecuteTuning(sd_card_t *card); +static inline status_t SD_ExecuteTuning(sd_card_t *card); /******************************************************************************* * Variables @@ -314,28 +314,28 @@ static uint32_t s_sdAuSizeMap[] = {0, /******************************************************************************* * Code ******************************************************************************/ -static status_t inline SD_SendApplicationCmd(sd_card_t *card, uint32_t relativeAddress) +static inline status_t SD_SendApplicationCmd(sd_card_t *card, uint32_t relativeAddress) { assert(card); return SDMMC_SendApplicationCommand(card->host.base, card->host.transfer, relativeAddress); } -static status_t inline SD_GoIdle(sd_card_t *card) +static inline status_t SD_GoIdle(sd_card_t *card) { assert(card); return SDMMC_GoIdle(card->host.base, card->host.transfer); } -static status_t inline SD_SetBlockSize(sd_card_t *card, uint32_t blockSize) +static inline status_t SD_SetBlockSize(sd_card_t *card, uint32_t blockSize) { assert(card); return SDMMC_SetBlockSize(card->host.base, card->host.transfer, blockSize); } -static status_t inline SD_ExecuteTuning(sd_card_t *card) +static inline status_t SD_ExecuteTuning(sd_card_t *card) { assert(card); From ccf66b7a5d56fa5a1f8367a328d4ac6876125cde Mon Sep 17 00:00:00 2001 From: Mathias Brossard Date: Thu, 8 Aug 2019 20:48:25 -0500 Subject: [PATCH 2/3] Add fall-through comment to remove warning --- target/TARGET_NXP/fsl_sd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/TARGET_NXP/fsl_sd.c b/target/TARGET_NXP/fsl_sd.c index 7f5d00a..5d586dc 100644 --- a/target/TARGET_NXP/fsl_sd.c +++ b/target/TARGET_NXP/fsl_sd.c @@ -1162,6 +1162,8 @@ static status_t SD_SelectBusTiming(sd_card_t *card) } SDMMC_LOG("\r\nNote: SDR104 mode is not supported by card"); + /* FALLTHROUGH */ + case kSD_TimingDDR50Mode: error = SD_SelectFunction(card, kSD_GroupTimingMode, kSD_FunctionDDR50); if (error == kStatus_Success) @@ -1174,6 +1176,8 @@ static status_t SD_SelectBusTiming(sd_card_t *card) } SDMMC_LOG("\r\nNote: DDR50 mode is not supported by card"); + /* FALLTHROUGH */ + case kSD_TimingSDR50Mode: error = SD_SelectFunction(card, kSD_GroupTimingMode, kSD_FunctionSDR50); if (error == kStatus_Success) @@ -1185,6 +1189,8 @@ static status_t SD_SelectBusTiming(sd_card_t *card) } SDMMC_LOG("\r\nNote: SDR50 mode is not supported by card"); + /* FALLTHROUGH */ + case kSD_TimingSDR25HighSpeedMode: error = SD_SelectFunction(card, kSD_GroupTimingMode, kSD_FunctionSDR25HighSpeed); if (error == kStatus_Success) From d5b72ebad83537821c77ec523515ae78b364a33e Mon Sep 17 00:00:00 2001 From: Mathias Brossard Date: Thu, 8 Aug 2019 20:49:02 -0500 Subject: [PATCH 3/3] Remove unused variable --- target/TARGET_NXP/sdio_device.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/TARGET_NXP/sdio_device.c b/target/TARGET_NXP/sdio_device.c index 0da019f..122ab50 100644 --- a/target/TARGET_NXP/sdio_device.c +++ b/target/TARGET_NXP/sdio_device.c @@ -17,8 +17,6 @@ #include "pinmap.h" #include "sdio_device.h" -/* Array of SD peripheral base address. */ -static SDIF_Type *const sd_addrs[] = SDIF_BASE_PTRS; static sd_card_t g_sd; extern void sdio_clock_setup(void);