Return -EINVAL for the internal API

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-09-26 19:08:24 +08:00 committed by Petro Karashchenko
parent bdeaea3742
commit e38248ee08
14 changed files with 15 additions and 14 deletions

View file

@ -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."
*/

View file

@ -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."
*/

View file

@ -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."
*/

View file

@ -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();

View file

@ -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

View file

@ -7651,6 +7651,7 @@ errout_with_xfrinfo:
while (0);
errout_with_sem:
/* rx65n_usbhost_givesem(&priv->exclsem); */
return nbytes;

View file

@ -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);

View file

@ -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();

View file

@ -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;
}
}

View file

@ -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,

View file

@ -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,

View file

@ -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."

View file

@ -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++)

View file

@ -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)