[errno code][-RT_ERROR] fix that use RT_ERROR without -

This commit is contained in:
Meco Man
2023-03-20 00:06:16 -04:00
committed by Man, Jianting (Meco)
parent de963feef4
commit 0f461e870c
272 changed files with 639 additions and 644 deletions
@@ -236,7 +236,7 @@ rt_inline rt_err_t rt_usb_hcd_alloc_pipe(uhcd_t hcd, upipe_t* pipe, uinst_t inst
*pipe = (upipe_t)rt_malloc(sizeof(struct upipe));
if(*pipe == RT_NULL)
{
return RT_ERROR;
return -RT_ERROR;
}
rt_memset(*pipe,0,sizeof(struct upipe));
(*pipe)->inst = inst;
+2 -2
View File
@@ -389,7 +389,7 @@ void rt_data_queue_reset(struct rt_data_queue *queue)
thread = rt_list_entry(queue->suspended_pop_list.next,
struct rt_thread,
tlist);
/* set error code to RT_ERROR */
/* set error code to -RT_ERROR */
thread->error = -RT_ERROR;
/*
@@ -413,7 +413,7 @@ void rt_data_queue_reset(struct rt_data_queue *queue)
thread = rt_list_entry(queue->suspended_push_list.next,
struct rt_thread,
tlist);
/* set error code to RT_ERROR */
/* set error code to -RT_ERROR */
thread->error = -RT_ERROR;
/*
+2 -2
View File
@@ -413,7 +413,7 @@ static int pwm(int argc, char **argv)
rt_kprintf("pwm set <channel> <period> <pulse> - set pwm channel info\n");
rt_kprintf("pwm phase <channel> <phase> - set pwm phase\n");
rt_kprintf("pwm dead_time <channel> <dead_time> - set pwm dead time\n");
result = - RT_ERROR;
result = -RT_ERROR;
}
}
}
@@ -427,7 +427,7 @@ static int pwm(int argc, char **argv)
rt_kprintf("pwm set <channel> <period> <pulse> - set pwm channel info\n");
rt_kprintf("pwm phase <channel> <phase> - set pwm phase\n");
rt_kprintf("pwm dead_time <channel> <dead_time> - set pwm dead time\n");
result = - RT_ERROR;
result = -RT_ERROR;
}
return RT_EOK;
+4 -4
View File
@@ -331,7 +331,7 @@ static rt_bool_t is_valid_date(struct tm *date)
static rt_err_t alarm_setup(rt_alarm_t alarm, struct tm *wktime)
{
rt_err_t ret = RT_ERROR;
rt_err_t ret = -RT_ERROR;
time_t timestamp = (time_t)0;
struct tm *setup, now;
@@ -502,7 +502,7 @@ void rt_alarm_update(rt_device_t dev, rt_uint32_t event)
*/
rt_err_t rt_alarm_control(rt_alarm_t alarm, int cmd, void *arg)
{
rt_err_t ret = RT_ERROR;
rt_err_t ret = -RT_ERROR;
RT_ASSERT(alarm != RT_NULL);
@@ -548,7 +548,7 @@ rt_err_t rt_alarm_start(rt_alarm_t alarm)
{
if (alarm_setup(alarm, &alarm->wktime) != RT_EOK)
{
ret = RT_ERROR;
ret = -RT_ERROR;
goto _exit;
}
@@ -642,7 +642,7 @@ rt_err_t rt_alarm_delete(rt_alarm_t alarm)
rt_err_t ret = RT_EOK;
if (alarm == RT_NULL)
return RT_ERROR;
return -RT_ERROR;
rt_mutex_take(&_container.mutex, RT_WAITING_FOREVER);
/* stop the alarm */
alarm->flag &= ~RT_ALARM_STATE_START;
+17 -17
View File
@@ -196,7 +196,7 @@ static rt_err_t _send_cmd(
if ((CARD_NCR_MAX + 1) == i)
{
return RT_ERROR;//fail
return -RT_ERROR;//fail
}
//recieve other byte
@@ -261,7 +261,7 @@ static rt_err_t _send_cmd(
}
else
{
return RT_ERROR; // unknow type?
return -RT_ERROR; // unknow type?
}
return RT_EOK;
@@ -426,7 +426,7 @@ static rt_err_t _write_block(struct rt_spi_device *device, const void *buffer, u
if (response != MSD_DATA_OK)
{
MSD_DEBUG("[err] write block fail! data response : 0x%02X\r\n", response);
return RT_ERROR;
return -RT_ERROR;
}
}
@@ -570,7 +570,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
{
/* SD2.0 not support current voltage */
MSD_DEBUG("[err] VCA = 0, SD2.0 not surpport current operation voltage range\r\n");
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
}
@@ -623,7 +623,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
if (0 == (OCR & (0x1 << 15)))
{
MSD_DEBUG(("[err] SD 1.x But not surpport current voltage\r\n"));
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
@@ -771,7 +771,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
{
rt_spi_release(msd->spi_device);
MSD_DEBUG("[err] It look CMD58 as illegal command so it is not SD card!\r\n");
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
@@ -786,7 +786,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
if (0 == (OCR & (0x1 << 15)))
{
MSD_DEBUG(("[err] SD 1.x But not surpport current voltage\r\n"));
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
@@ -801,7 +801,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
{
rt_spi_release(msd->spi_device);
MSD_DEBUG("[err] SD Ver2.x or later try CMD55 + ACMD41 timeout!\r\n");
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
@@ -818,7 +818,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
{
rt_spi_release(msd->spi_device);
MSD_DEBUG("[err] Not SD ready!\r\n");
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
@@ -828,7 +828,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
{
rt_spi_release(msd->spi_device);
MSD_DEBUG("[err] ACMD41 fail!\r\n");
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
@@ -857,7 +857,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
{
rt_spi_release(msd->spi_device);
MSD_DEBUG("[err] It look 2nd CMD58 as illegal command so it is not SD card!\r\n");
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
rt_spi_release(msd->spi_device);
@@ -881,7 +881,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
else
{
MSD_DEBUG("[err] SD card type unkonw!\r\n");
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
} /* init SD card */
@@ -918,7 +918,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR))
{
MSD_DEBUG("[err] CMD59 CRC_ON_OFF fail! response : 0x%02X\r\n", response[0]);
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
} /* set CRC */
@@ -932,7 +932,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR))
{
MSD_DEBUG("[err] CMD16 SET_BLOCKLEN fail! response : 0x%02X\r\n", response[0]);
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
msd->geometry.block_size = SECTOR_SIZE;
@@ -958,7 +958,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
{
rt_spi_release(msd->spi_device);
MSD_DEBUG("[err] CMD9 SEND_CSD fail! response : 0x%02X\r\n", response[0]);
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
@@ -993,7 +993,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
if (CSD_STRUCTURE > 2)
{
MSD_DEBUG("[err] bad CSD Version : %d\r\n", CSD_STRUCTURE);
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
@@ -1174,7 +1174,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
else
{
MSD_DEBUG("[err] bad CSD Version : %d\r\n", CSD_STRUCTURE);
result = RT_ERROR;
result = -RT_ERROR;
goto _exit;
}
} /* SD CSD Analyze. */
+1 -1
View File
@@ -82,7 +82,7 @@ static rt_err_t iodev_open(struct tty_struct *console)
ret = rt_device_open(console->driver, oflags);
if (ret != RT_EOK)
{
return RT_ERROR;
return -RT_ERROR;
}
rx_notify.notify = console_rx_notify;
@@ -240,7 +240,7 @@ rt_weak rt_err_t vcom_get_stored_serno(char *serno, int size);
rt_err_t vcom_get_stored_serno(char *serno, int size)
{
return RT_ERROR;
return -RT_ERROR;
}
rt_align(4)
const static char* _ustring[] =
@@ -87,7 +87,7 @@ rt_err_t rt_usbd_class_register(udclass_t udclass)
if(!rt_list_isempty(&class_list))
{
rt_kprintf("[D/USBD] If you want to use usb composite device please define RT_USB_DEVICE_COMPOSITE\n");
return RT_ERROR;
return -RT_ERROR;
}
#endif
rt_list_insert_before(&class_list,&udclass->list);
@@ -106,7 +106,7 @@ rt_err_t rt_usb_device_init(void)
if(rt_list_isempty(&class_list))
{
rt_kprintf("[D/USBD] No class register on usb device\n");
return RT_ERROR;
return -RT_ERROR;
}
/* create and startup usb device thread */
rt_usbd_core_init();
@@ -558,7 +558,7 @@ static rt_err_t _standard_request(struct udevice* device, ureq_t setup)
{
rt_kprintf("unknown interface request\n");
rt_usbd_ep0_set_stall(device);
return - RT_ERROR;
return -RT_ERROR;
}
else
break;
+2 -2
View File
@@ -75,7 +75,7 @@ static rt_err_t root_hub_ctrl(struct uhcd *hcd, rt_uint16_t port, rt_uint8_t cmd
}
break;
default:
return RT_ERROR;
return -RT_ERROR;
}
return RT_EOK;
}
@@ -576,7 +576,7 @@ static rt_err_t rt_usbh_hub_enable(void *arg)
pipe_in = rt_usb_instance_find_pipe(device,ep_desc->bEndpointAddress);
if(pipe_in == RT_NULL)
{
return RT_ERROR;
return -RT_ERROR;
}
rt_usb_pipe_add_callback(pipe_in,rt_usbh_hub_irq);
}
@@ -205,14 +205,14 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
if(rt_usb_hcd_alloc_pipe(device->hcd, &pipe, device, ep_desc) != RT_EOK)
{
rt_kprintf("alloc pipe failed\n");
return RT_ERROR;
return -RT_ERROR;
}
rt_usb_instance_add_pipe(device,pipe);
}
else
{
rt_kprintf("get endpoint desc failed\n");
return RT_ERROR;
return -RT_ERROR;
}
}
/* find driver by class code found in interface descriptor */
@@ -332,7 +332,7 @@ rt_err_t rt_usbh_get_descriptor(uinst_t device, rt_uint8_t type, void* buffer,
}
}
}
return RT_ERROR;
return -RT_ERROR;
}
/**
@@ -360,7 +360,7 @@ rt_err_t rt_usbh_set_address(uinst_t device)
if(rt_usb_hcd_setup_xfer(device->hcd, device->pipe_ep0_out, &setup, timeout) != 8)
{
return RT_ERROR;
return -RT_ERROR;
}
if(rt_usb_hcd_pipe_xfer(device->hcd, device->pipe_ep0_in, RT_NULL, 0, timeout) == 0)
{
@@ -395,11 +395,11 @@ rt_err_t rt_usbh_set_configure(uinst_t device, int config)
if(rt_usb_hcd_setup_xfer(device->hcd, device->pipe_ep0_out, &setup, timeout) != 8)
{
return RT_ERROR;
return -RT_ERROR;
}
if(rt_usb_hcd_pipe_xfer(device->hcd, device->pipe_ep0_in, RT_NULL, 0, timeout) != 0)
{
return RT_ERROR;
return -RT_ERROR;
}
return RT_EOK;
}
@@ -429,7 +429,7 @@ rt_err_t rt_usbh_set_interface(uinst_t device, int intf)
if(rt_usb_hcd_setup_xfer(device->hcd, device->pipe_ep0_out, &setup, timeout) != 8)
{
return RT_ERROR;
return -RT_ERROR;
}
return RT_EOK;
@@ -460,7 +460,7 @@ rt_err_t rt_usbh_clear_feature(uinst_t device, int endpoint, int feature)
if(rt_usb_hcd_setup_xfer(device->hcd, device->pipe_ep0_out, &setup, timeout) != 8)
{
return RT_ERROR;
return -RT_ERROR;
}
return RT_EOK;
@@ -180,7 +180,7 @@ static rt_err_t rt_link_event_recv(struct rt_link_service *service)
{
return ret;
}
return RT_ERROR;
return -RT_ERROR;
}
static void send_cb(struct rt_link_service *service, void *buffer)
+1 -1
View File
@@ -187,7 +187,7 @@ static rt_err_t zrec_files(struct zfile *zf)
/* receive file */
static rt_err_t zrec_file(rt_uint8_t *rxbuf, struct zfile *zf)
{
rt_err_t res = - RT_ERROR;
rt_err_t res = -RT_ERROR;
rt_uint16_t err_cnt = 0;
do
+1 -1
View File
@@ -39,7 +39,7 @@ static void zsay_bibi(void);
void zs_start(char *path)
{
struct zfile *zf;
rt_err_t res = RT_ERROR;
rt_err_t res = -RT_ERROR;
char *p,*q;
zf = rt_malloc(sizeof(struct zfile));
if (zf == RT_NULL)
+1 -1
View File
@@ -90,7 +90,7 @@ void rt_prio_queue_detach(struct rt_prio_queue *que)
/* get next suspend thread */
thread = rt_list_entry(que->suspended_pop_list.next, struct rt_thread, tlist);
/* set error code to RT_ERROR */
/* set error code to -RT_ERROR */
thread->error = -RT_ERROR;
rt_thread_resume(thread);