From fed0028084e080979f4c2707d9fb3570ac862baf Mon Sep 17 00:00:00 2001 From: NickYang Date: Tue, 22 Sep 2020 14:50:42 +0800 Subject: [PATCH] platform driver log format fix --- support/platform/src/gpio_core.c | 2 +- support/platform/src/gpio_if.c | 2 +- support/platform/src/i2c_core.c | 12 ++++++------ support/platform/src/i2c_if.c | 6 +++--- support/platform/src/spi_core.c | 16 ++++++++-------- support/platform/src/spi_if.c | 8 ++++---- support/platform/src/uart_core.c | 4 ++-- support/platform/src/uart_if.c | 12 ++++++------ support/platform/src/watchdog_if.c | 6 +++--- 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/support/platform/src/gpio_core.c b/support/platform/src/gpio_core.c index c139fa9fe..e060637f8 100755 --- a/support/platform/src/gpio_core.c +++ b/support/platform/src/gpio_core.c @@ -71,7 +71,7 @@ void GpioCntlrRemove(struct GpioCntlr *cntlr) } if (cntlr->device == NULL) { - HDF_LOGE("GpioCntlrRemove: no device associated!\n"); + HDF_LOGE("GpioCntlrRemove: no device associated!"); return; } diff --git a/support/platform/src/gpio_if.c b/support/platform/src/gpio_if.c index 173ecb2f4..ed8b2b729 100755 --- a/support/platform/src/gpio_if.c +++ b/support/platform/src/gpio_if.c @@ -46,7 +46,7 @@ static struct GpioCntlr *GpioGetCntlr(void) } service = (struct GpioCntlr*)DevSvcManagerClntGetService("HDF_PLATFORM_GPIO"); if (service == NULL) { - HDF_LOGE("GpioGetCntlr: get service fail!\n"); + HDF_LOGE("GpioGetCntlr: get service fail!"); } return service; } diff --git a/support/platform/src/i2c_core.c b/support/platform/src/i2c_core.c index 8f92858bd..3c4c79250 100755 --- a/support/platform/src/i2c_core.c +++ b/support/platform/src/i2c_core.c @@ -41,12 +41,12 @@ int32_t I2cCntlrTransfer(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t co int32_t ret; if (cntlr == NULL) { - HDF_LOGE("I2cCntlrTransfer: cntlr is null\n"); + HDF_LOGE("I2cCntlrTransfer: cntlr is null"); return HDF_ERR_INVALID_OBJECT; } if (cntlr->ops == NULL || cntlr->ops->transfer == NULL) { - HDF_LOGE("I2cCntlrTransfer: ops or transfer is null\n"); + HDF_LOGE("I2cCntlrTransfer: ops or transfer is null"); return HDF_ERR_NOT_SUPPORT; } @@ -61,16 +61,16 @@ int32_t I2cCntlrAdd(struct I2cCntlr *cntlr) } if (cntlr->device == NULL) { - HDF_LOGE("I2cCntlrAdd: no device associated!\n"); + HDF_LOGE("I2cCntlrAdd: no device associated!"); return HDF_ERR_INVALID_OBJECT; } if (cntlr->ops == NULL) { - HDF_LOGE("I2cCntlrAdd: no ops supplied!\n"); + HDF_LOGE("I2cCntlrAdd: no ops supplied!"); return HDF_ERR_INVALID_OBJECT; } if (OsalMutexInit(&cntlr->lock) != HDF_SUCCESS) { - HDF_LOGE("I2cCntlrAdd: init lock fail!\n"); + HDF_LOGE("I2cCntlrAdd: init lock fail!"); return HDF_FAILURE; } cntlr->device->service = &cntlr->service; @@ -84,7 +84,7 @@ void I2cCntlrRemove(struct I2cCntlr *cntlr) } if (cntlr->device == NULL) { - HDF_LOGE("I2cCntlrBind: no device associated!\n"); + HDF_LOGE("I2cCntlrBind: no device associated!"); return; } diff --git a/support/platform/src/i2c_if.c b/support/platform/src/i2c_if.c index fdc8ad121..66f9b479d 100755 --- a/support/platform/src/i2c_if.c +++ b/support/platform/src/i2c_if.c @@ -48,7 +48,7 @@ static struct I2cCntlr *I2cCntlrGetByNumber(int16_t num) char *cntlrName = NULL; if (num < 0 || num >= I2C_BUS_MAX) { - HDF_LOGE("I2cCntlrGetByNumber: invalid num:%d\n", num); + HDF_LOGE("I2cCntlrGetByNumber: invalid num:%d", num); return NULL; } cntlrName = OsalMemCalloc(SERVICE_NAME_LEN + 1); @@ -57,13 +57,13 @@ static struct I2cCntlr *I2cCntlrGetByNumber(int16_t num) } if (snprintf_s(cntlrName, SERVICE_NAME_LEN + 1, SERVICE_NAME_LEN, "HDF_PLATFORM_I2C_%d", num) < 0) { - HDF_LOGE("I2cCntlrGetByNumber: format cntlr name fail!\n"); + HDF_LOGE("I2cCntlrGetByNumber: format cntlr name fail!"); OsalMemFree(cntlrName); return NULL; } cntlr = (struct I2cCntlr *)DevSvcManagerClntGetService(cntlrName); if (cntlr == NULL) { - HDF_LOGE("I2cCntlrGetByNumber: get cntlr fail!\n"); + HDF_LOGE("I2cCntlrGetByNumber: get cntlr fail!"); } OsalMemFree(cntlrName); return cntlr; diff --git a/support/platform/src/spi_core.c b/support/platform/src/spi_core.c index b9339c898..91bd71de3 100755 --- a/support/platform/src/spi_core.c +++ b/support/platform/src/spi_core.c @@ -42,11 +42,11 @@ int32_t SpiCntlrTransfer(struct SpiCntlr *cntlr, uint32_t csNum, struct SpiMsg * int32_t ret; if (cntlr == NULL) { - HDF_LOGE("%s: invalid parameter\n", __func__); + HDF_LOGE("%s: invalid parameter", __func__); return HDF_ERR_INVALID_PARAM; } if (cntlr->method == NULL || cntlr->method->Transfer == NULL) { - HDF_LOGE("%s: transfer not support\n", __func__); + HDF_LOGE("%s: transfer not support", __func__); return HDF_ERR_NOT_SUPPORT; } @@ -62,12 +62,12 @@ int32_t SpiCntlrSetCfg(struct SpiCntlr *cntlr, uint32_t csNum, struct SpiCfg *cf int32_t ret; if (cntlr == NULL) { - HDF_LOGE("%s: invalid parameter\n", __func__); + HDF_LOGE("%s: invalid parameter", __func__); return HDF_ERR_INVALID_PARAM; } if (cntlr->method == NULL || cntlr->method->SetCfg == NULL) { - HDF_LOGE("%s: not support\n", __func__); + HDF_LOGE("%s: not support", __func__); return HDF_ERR_NOT_SUPPORT; } @@ -83,12 +83,12 @@ int32_t SpiCntlrGetCfg(struct SpiCntlr *cntlr, uint32_t csNum, struct SpiCfg *cf int32_t ret; if (cntlr == NULL) { - HDF_LOGE("%s: invalid parameter\n", __func__); + HDF_LOGE("%s: invalid parameter", __func__); return HDF_ERR_INVALID_PARAM; } if (cntlr->method == NULL || cntlr->method->GetCfg == NULL) { - HDF_LOGE("%s: not support\n", __func__); + HDF_LOGE("%s: not support", __func__); return HDF_ERR_NOT_SUPPORT; } @@ -113,13 +113,13 @@ struct SpiCntlr *SpiCntlrCreate(struct HdfDeviceObject *device) struct SpiCntlr *cntlr = NULL; if (device == NULL) { - HDF_LOGE("%s: invalid parameter\n", __func__); + HDF_LOGE("%s: invalid parameter", __func__); return NULL; } cntlr = (struct SpiCntlr *)OsalMemCalloc(sizeof(*cntlr)); if (cntlr == NULL) { - HDF_LOGE("%s: OsalMemCalloc error\n", __func__); + HDF_LOGE("%s: OsalMemCalloc error", __func__); return NULL; } cntlr->device = device; diff --git a/support/platform/src/spi_if.c b/support/platform/src/spi_if.c index 7c20d5e91..cf54b0224 100755 --- a/support/platform/src/spi_if.c +++ b/support/platform/src/spi_if.c @@ -56,7 +56,7 @@ static struct SpiCntlr *SpiGetCntlrByBusNum(uint32_t num) } ret = snprintf_s(name, HOST_NAME_LEN + 1, HOST_NAME_LEN, "HDF_PLATFORM_SPI_%u", num); if (ret < 0) { - HDF_LOGE("%s: snprintf_s failed\n", __func__); + HDF_LOGE("%s: snprintf_s failed", __func__); OsalMemFree(name); return NULL; } @@ -121,7 +121,7 @@ int32_t SpiGetCfg(struct DevHandle *handle, struct SpiCfg *cfg) void SpiClose(struct DevHandle *handle) { if (handle == NULL) { - HDF_LOGE("%s: handle is NULL\n", __func__); + HDF_LOGE("%s: handle is NULL", __func__); return; } if (handle->object != NULL) { @@ -147,12 +147,12 @@ struct DevHandle *SpiOpen(const struct SpiDevInfo *info) } handle = (struct DevHandle *)OsalMemCalloc(sizeof(*handle)); if (handle == NULL) { - HDF_LOGE("%s: handle malloc error\n", __func__); + HDF_LOGE("%s: handle malloc error", __func__); return NULL; } object = (struct SpiObject *)OsalMemCalloc(sizeof(*object)); if (object == NULL) { - HDF_LOGE("%s: object malloc error\n", __func__); + HDF_LOGE("%s: object malloc error", __func__); OsalMemFree(handle); return NULL; } diff --git a/support/platform/src/uart_core.c b/support/platform/src/uart_core.c index 0831580b7..6bea0e0da 100755 --- a/support/platform/src/uart_core.c +++ b/support/platform/src/uart_core.c @@ -50,12 +50,12 @@ struct UartHost *UartHostCreate(struct HdfDeviceObject *device) struct UartHost *host = NULL; if (device == NULL) { - HDF_LOGE("%s: invalid parameter\n", __func__); + HDF_LOGE("%s: invalid parameter", __func__); return NULL; } host = (struct UartHost *)OsalMemCalloc(sizeof(*host)); if (host == NULL) { - HDF_LOGE("%s: OsalMemCalloc error\n", __func__); + HDF_LOGE("%s: OsalMemCalloc error", __func__); return NULL; } host->device = device; diff --git a/support/platform/src/uart_if.c b/support/platform/src/uart_if.c index bc767e96e..e1a8018b4 100755 --- a/support/platform/src/uart_if.c +++ b/support/platform/src/uart_if.c @@ -52,7 +52,7 @@ static struct UartHost *UartGetHostByBusNum(uint32_t num) ret = snprintf_s(name, UART_HOST_NAME_LEN + 1, UART_HOST_NAME_LEN, "HDF_PLATFORM_UART_%u", num); if (ret < 0) { - HDF_LOGE("%s: snprintf_s failed\n", __func__); + HDF_LOGE("%s: snprintf_s failed", __func__); OsalMemFree(name); return NULL; } @@ -68,16 +68,16 @@ struct DevHandle *UartOpen(uint32_t port) host = UartGetHostByBusNum(port); if (host == NULL) { - HDF_LOGE("%s: get host error\n", __func__); + HDF_LOGE("%s: get host error", __func__); return NULL; } handle = (struct DevHandle *)OsalMemCalloc(sizeof(*handle)); if (handle == NULL) { - HDF_LOGE("%s: handle malloc error\n", __func__); + HDF_LOGE("%s: handle malloc error", __func__); return NULL; } if (UartHostInit(host) != HDF_SUCCESS) { - HDF_LOGE("%s: UartHostInit error\n", __func__); + HDF_LOGE("%s: UartHostInit error", __func__); OsalMemFree(handle); return NULL; } @@ -88,11 +88,11 @@ struct DevHandle *UartOpen(uint32_t port) void UartClose(struct DevHandle *handle) { if (handle == NULL) { - HDF_LOGE("%s: handle is NULL\n", __func__); + HDF_LOGE("%s: handle is NULL", __func__); return; } if (UartHostDeinit((struct UartHost *)handle->object) != HDF_SUCCESS) { - HDF_LOGE("%s: UartHostDeinit error\n", __func__); + HDF_LOGE("%s: UartHostDeinit error", __func__); } OsalMemFree(handle); } diff --git a/support/platform/src/watchdog_if.c b/support/platform/src/watchdog_if.c index 4118b272f..c00431f89 100755 --- a/support/platform/src/watchdog_if.c +++ b/support/platform/src/watchdog_if.c @@ -48,7 +48,7 @@ static struct Watchdog *WatchdogGetById(int16_t wdtId) struct Watchdog *service = NULL; if (wdtId < 0 || wdtId >= WATCHDOG_ID_MAX) { - HDF_LOGE("WatchdogGetById: invalid id:%d\n", wdtId); + HDF_LOGE("WatchdogGetById: invalid id:%d", wdtId); return NULL; } serviceName = OsalMemCalloc(WATCHDOG_NAME_LEN + 1); @@ -57,13 +57,13 @@ static struct Watchdog *WatchdogGetById(int16_t wdtId) } if (snprintf_s(serviceName, WATCHDOG_NAME_LEN + 1, WATCHDOG_NAME_LEN, "HDF_PLATFORM_WATCHDOG_%d", wdtId) < 0) { - HDF_LOGE("WatchdogGetById: format service name fail!\n"); + HDF_LOGE("WatchdogGetById: format service name fail!"); OsalMemFree(serviceName); return NULL; } service = (struct Watchdog *)DevSvcManagerClntGetService(serviceName); if (service == NULL) { - HDF_LOGE("WatchdogGetById: get service fail!\n"); + HDF_LOGE("WatchdogGetById: get service fail!"); } OsalMemFree(serviceName); return service; -- Gitee