From 7fd619dd0a8e307926c0880a4cc620078988645f Mon Sep 17 00:00:00 2001 From: yinshuqing Date: Fri, 24 Sep 2021 16:59:49 +0800 Subject: [PATCH] =?UTF-8?q?0924-mtd=20reviewbot=20=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yinshuqing --- mtd/hifmc100/spi_nand/hifmc100_spi_nand_ids.c | 6 +++--- mtd/hifmc100/spi_nor/hifmc100_spi_nor.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mtd/hifmc100/spi_nand/hifmc100_spi_nand_ids.c b/mtd/hifmc100/spi_nand/hifmc100_spi_nand_ids.c index 4248dd1..a52b9e7 100644 --- a/mtd/hifmc100/spi_nand/hifmc100_spi_nand_ids.c +++ b/mtd/hifmc100/spi_nand/hifmc100_spi_nand_ids.c @@ -129,7 +129,7 @@ static int32_t HifmcCntlrSpinandQeEnableDefault(struct SpiFlash *spi) feature &= ~MTD_SPI_FEATURE_QE_ENABLE; } #ifdef MTD_DEBUG - HDF_LOGD("%s: spi nand %s quad", __func__, enable == 1 ? "enable" : "disable"); + HDF_LOGD("%s: spi nand %s quad", __func__, (enable == 1) ? "enable" : "disable"); #endif ret = HifmcCntlrDevFeatureOp(cntlr, spi, false, MTD_SPI_NAND_FEATURE_ADDR, &feature); if (ret != HDF_SUCCESS) { @@ -142,10 +142,10 @@ static int32_t HifmcCntlrSpinandQeEnableDefault(struct SpiFlash *spi) return ret; } if (!!(feature & MTD_SPI_FEATURE_QE_ENABLE) == enable) { - HDF_LOGD("%s: spi nand %s quad success", __func__, enable == 1 ? "enable" : "disable"); + HDF_LOGD("%s: spi nand %s quad success", __func__, (enable == 1) ? "enable" : "disable"); return HDF_SUCCESS; } else { - HDF_LOGE("%s: spi nand %s quad failed", __func__, enable == 1 ? "enable" : "disable"); + HDF_LOGE("%s: spi nand %s quad failed", __func__, (enable == 1) ? "enable" : "disable"); return HDF_ERR_IO; } } diff --git a/mtd/hifmc100/spi_nor/hifmc100_spi_nor.c b/mtd/hifmc100/spi_nor/hifmc100_spi_nor.c index c5c9956..11d936a 100644 --- a/mtd/hifmc100/spi_nor/hifmc100_spi_nor.c +++ b/mtd/hifmc100/spi_nor/hifmc100_spi_nor.c @@ -371,7 +371,7 @@ static int32_t HifmcCntlrDmaWriteRead(struct MtdDevice *mtdDevice, off_t offset, sizeR = len; - for (i = 0, num=*sizeArray[0]; i < (sizeof(sizeArray) / sizeof(sizeArray[0])); i++) { + for (i = 0, num = *sizeArray[0]; i < (sizeof(sizeArray) / sizeof(sizeArray[0])); i++) { num = *sizeArray[i]; if (num == 0) { continue; @@ -383,7 +383,7 @@ static int32_t HifmcCntlrDmaWriteRead(struct MtdDevice *mtdDevice, off_t offset, } } ret = HifmcCntlrDmaTransfer(cntlr, spi, offset, - (uint8_t *)(uintptr_t)LOS_PaddrQuery((void *)(i != 1 ? cntlr->dmaBuffer : buf)), num, wr); + (uint8_t *)(uintptr_t)LOS_PaddrQuery((void *)((i != 1) ? (cntlr->dmaBuffer) : buf)), num, wr); if (ret != HDF_SUCCESS) { HDF_LOGE("%s: size[%d] = %u dma trans failed", __func__, i, num); return HDF_ERR_IO; -- Gitee