This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit e38248ee0880d152fa1669436189c0bfb2397196
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Mon Sep 26 19:08:24 2022 +0800

    Return -EINVAL for the internal API
    
    Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com>
---
 arch/arm/src/stm32/stm32_bbsram.c               | 2 +-
 arch/arm/src/stm32f7/stm32_bbsram.c             | 2 +-
 arch/arm/src/stm32h7/stm32_bbsram.c             | 2 +-
 arch/renesas/src/rx65n/rx65n_rspi.c             | 4 ++--
 arch/renesas/src/rx65n/rx65n_sbram.c            | 2 +-
 arch/renesas/src/rx65n/rx65n_usbhost.c          | 1 +
 arch/risc-v/src/esp32c3/esp32c3_wdt_lowerhalf.c | 2 +-
 arch/xtensa/src/esp32/esp32_pm.c                | 2 +-
 arch/xtensa/src/esp32/esp32_wdt.c               | 2 +-
 drivers/bch/bchdev_driver.c                     | 2 +-
 drivers/eeprom/i2c_xx24xx.c                     | 2 +-
 drivers/eeprom/spi_xx25xx.c                     | 2 +-
 libs/libc/netdb/lib_getservbynamer.c            | 2 +-
 sched/clock/clock_abstime2ticks.c               | 2 +-
 14 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/arch/arm/src/stm32/stm32_bbsram.c 
b/arch/arm/src/stm32/stm32_bbsram.c
index 75ddeca366..0c08326cf5 100644
--- a/arch/arm/src/stm32/stm32_bbsram.c
+++ b/arch/arm/src/stm32/stm32_bbsram.c
@@ -424,7 +424,7 @@ static off_t stm32_bbsram_seek(struct file *filep, off_t 
offset,
    *   point, subsequent reads of data in the gap shall return bytes with the
    *   value 0 until data is actually written into the gap."
    *
-   * We can conform to the first part, but not the second.  But return EINVAL
+   * We can conform to the first part, but not the second. But return -EINVAL
    * if "...the resulting file offset would be negative for a regular file,
    *     block special file, or directory."
    */
diff --git a/arch/arm/src/stm32f7/stm32_bbsram.c 
b/arch/arm/src/stm32f7/stm32_bbsram.c
index d02125386a..6ff5295bde 100644
--- a/arch/arm/src/stm32f7/stm32_bbsram.c
+++ b/arch/arm/src/stm32f7/stm32_bbsram.c
@@ -424,7 +424,7 @@ static off_t stm32_bbsram_seek(struct file *filep, off_t 
offset,
    *   point, subsequent reads of data in the gap shall return bytes with the
    *   value 0 until data is actually written into the gap."
    *
-   * We can conform to the first part, but not the second.  But return EINVAL
+   * We can conform to the first part, but not the second. But return -EINVAL
    * if "...the resulting file offset would be negative for a regular file,
    *     block special file, or directory."
    */
diff --git a/arch/arm/src/stm32h7/stm32_bbsram.c 
b/arch/arm/src/stm32h7/stm32_bbsram.c
index e8b48250d9..4c14bcd8f6 100644
--- a/arch/arm/src/stm32h7/stm32_bbsram.c
+++ b/arch/arm/src/stm32h7/stm32_bbsram.c
@@ -470,7 +470,7 @@ static off_t stm32_bbsram_seek(struct file *filep, off_t 
offset,
    *   point, subsequent reads of data in the gap shall return bytes with the
    *   value 0 until data is actually written into the gap."
    *
-   * We can conform to the first part, but not the second.  But return EINVAL
+   * We can conform to the first part, but not the second. But return -EINVAL
    * if "...the resulting file offset would be negative for a regular file,
    *     block special file, or directory."
    */
diff --git a/arch/renesas/src/rx65n/rx65n_rspi.c 
b/arch/renesas/src/rx65n/rx65n_rspi.c
index 0ed4e263a2..0aa6994dec 100644
--- a/arch/renesas/src/rx65n/rx65n_rspi.c
+++ b/arch/renesas/src/rx65n/rx65n_rspi.c
@@ -1303,14 +1303,14 @@ static int rspi_transfer(struct rx65n_rspidev_s *priv, 
const void *txbuffer,
   if (ret > 1)
     {
       spierr("ERROR:Fail to setup DTC for TX transfer\n");
-      return EINVAL;
+      return -EINVAL;
     }
 
   ret = rspi_dtcrxsetup(priv, rxbuffer, &rxdummy, nwords);
   if (ret > 1)
     {
       spierr("ERROR:[%d] Fail to setup DTC for RX transfer\n");
-      return EINVAL;
+      return -EINVAL;
     }
 
   flags = enter_critical_section();
diff --git a/arch/renesas/src/rx65n/rx65n_sbram.c 
b/arch/renesas/src/rx65n/rx65n_sbram.c
index 08874f1b51..546c8ba07a 100644
--- a/arch/renesas/src/rx65n/rx65n_sbram.c
+++ b/arch/renesas/src/rx65n/rx65n_sbram.c
@@ -377,7 +377,7 @@ static off_t rx65n_sbram_seek(FAR struct file *filep, off_t 
offset,
    *   0 until data is actually written into the gap."
    *
    * We can conform to the first part, but not the second.
-   * But return EINVAL if
+   * But return -EINVAL if
    *
    *  "...the resulting file offset would be negative for a regular
    *  file, block
diff --git a/arch/renesas/src/rx65n/rx65n_usbhost.c 
b/arch/renesas/src/rx65n/rx65n_usbhost.c
index 4ae6896cf9..5b158f384e 100644
--- a/arch/renesas/src/rx65n/rx65n_usbhost.c
+++ b/arch/renesas/src/rx65n/rx65n_usbhost.c
@@ -7651,6 +7651,7 @@ errout_with_xfrinfo:
   while (0);
 
 errout_with_sem:
+
   /* rx65n_usbhost_givesem(&priv->exclsem); */
 
   return nbytes;
diff --git a/arch/risc-v/src/esp32c3/esp32c3_wdt_lowerhalf.c 
b/arch/risc-v/src/esp32c3/esp32c3_wdt_lowerhalf.c
index ee6e837ec7..490bf78535 100644
--- a/arch/risc-v/src/esp32c3/esp32c3_wdt_lowerhalf.c
+++ b/arch/risc-v/src/esp32c3/esp32c3_wdt_lowerhalf.c
@@ -699,7 +699,7 @@ int esp32c3_wdt_initialize(const char *devpath, enum 
esp32c3_wdt_inst_e wdt)
 
   if (lower->wdt == NULL)
     {
-      return = -EINVAL;
+      return -EINVAL;
     }
 
   lower->started = esp32c3_wdt_is_running(lower->wdt);
diff --git a/arch/xtensa/src/esp32/esp32_pm.c b/arch/xtensa/src/esp32/esp32_pm.c
index b0cc20d5a4..0bf60c6de8 100644
--- a/arch/xtensa/src/esp32/esp32_pm.c
+++ b/arch/xtensa/src/esp32/esp32_pm.c
@@ -681,7 +681,7 @@ static int IRAM_ATTR esp32_configure_cpu_freq(uint32_t 
cpu_freq_mhz)
     }
   else
     {
-      return EINVAL;
+      return -EINVAL;
     }
 
   xtal_freq = esp32_rtc_clk_xtal_freq_get();
diff --git a/arch/xtensa/src/esp32/esp32_wdt.c 
b/arch/xtensa/src/esp32/esp32_wdt.c
index 6406d869b4..ef9381559b 100644
--- a/arch/xtensa/src/esp32/esp32_wdt.c
+++ b/arch/xtensa/src/esp32/esp32_wdt.c
@@ -651,7 +651,7 @@ static int esp32_wdt_settimeout(struct esp32_wdt_dev_s *dev,
       default:
         {
           tmrerr("ERROR: unsupported stage %d\n", stage);
-          return EINVAL;
+          return -EINVAL;
         }
     }
 
diff --git a/drivers/bch/bchdev_driver.c b/drivers/bch/bchdev_driver.c
index 872311fa44..6de05af454 100644
--- a/drivers/bch/bchdev_driver.c
+++ b/drivers/bch/bchdev_driver.c
@@ -261,7 +261,7 @@ static off_t bch_seek(FAR struct file *filep, off_t offset, 
int whence)
    *   point, subsequent reads of data in the gap shall return bytes with the
    *   value 0 until data is actually written into the gap."
    *
-   * We can conform to the first part, but not the second.  But return EINVAL
+   * We can conform to the first part, but not the second. But return -EINVAL
    * if:
    *
    *  "...the resulting file offset would be negative for a regular file,
diff --git a/drivers/eeprom/i2c_xx24xx.c b/drivers/eeprom/i2c_xx24xx.c
index a8d4862003..0a726cc1b8 100644
--- a/drivers/eeprom/i2c_xx24xx.c
+++ b/drivers/eeprom/i2c_xx24xx.c
@@ -497,7 +497,7 @@ static off_t ee24xx_seek(FAR struct file *filep, off_t 
offset, int whence)
    *   this point, subsequent reads of data in the gap shall return bytes
    *   with the value 0 until data is actually written into the gap."
    *
-   * We can conform to the first part, but not the second.  But return EINVAL
+   * We can conform to the first part, but not the second. But return -EINVAL
    * if
    *
    *  "...the resulting file offset would be negative for a regular file,
diff --git a/drivers/eeprom/spi_xx25xx.c b/drivers/eeprom/spi_xx25xx.c
index 521458b4c8..29229d2871 100644
--- a/drivers/eeprom/spi_xx25xx.c
+++ b/drivers/eeprom/spi_xx25xx.c
@@ -614,7 +614,7 @@ static off_t ee25xx_seek(FAR struct file *filep, off_t 
offset, int whence)
    *  value 0 until data is actually written into the gap."
    *
    * We can conform to the first part, but not the second.
-   * But return EINVAL if
+   * But return -EINVAL if
    *
    *  "...the resulting file offset would be negative for a regular file,
    *  block special file, or directory."
diff --git a/libs/libc/netdb/lib_getservbynamer.c 
b/libs/libc/netdb/lib_getservbynamer.c
index d9c72c8603..a764ebcd20 100644
--- a/libs/libc/netdb/lib_getservbynamer.c
+++ b/libs/libc/netdb/lib_getservbynamer.c
@@ -87,7 +87,7 @@ int getservbyname_r(FAR const char *name, FAR const char 
*proto,
     }
   else
     {
-      return EINVAL;
+      return -EINVAL;
     }
 
   for (i = 0; g_services_db[i].s_name; i++)
diff --git a/sched/clock/clock_abstime2ticks.c 
b/sched/clock/clock_abstime2ticks.c
index 4b7796e69d..592db13a97 100644
--- a/sched/clock/clock_abstime2ticks.c
+++ b/sched/clock/clock_abstime2ticks.c
@@ -95,7 +95,7 @@ int clock_abstime2ticks(clockid_t clockid,
   ret = clock_gettime(clockid, &currtime);
   if (ret != OK)
     {
-      return EINVAL;
+      return ret;
     }
 
   if (clock_timespec_compare(abstime, &currtime) < 0)

Reply via email to