diff options
| author | Meco Man <[email protected]> | 2023-03-17 00:12:16 -0400 |
|---|---|---|
| committer | Man, Jianting (Meco) <[email protected]> | 2023-03-20 00:06:16 -0400 |
| commit | 0f461e870c481a24ce2690cca1949706bb80f9e7 (patch) | |
| tree | e77c8813658be76824bb848346cf9ef2340806f2 /components | |
| parent | de963feef4c5075626858c97413186fc2a309ffe (diff) | |
[errno code][-RT_ERROR] fix that use RT_ERROR without -
Diffstat (limited to 'components')
| -rw-r--r-- | components/drivers/include/drivers/usb_host.h | 2 | ||||
| -rw-r--r-- | components/drivers/ipc/dataqueue.c | 4 | ||||
| -rw-r--r-- | components/drivers/misc/rt_drv_pwm.c | 4 | ||||
| -rw-r--r-- | components/drivers/rtc/alarm.c | 8 | ||||
| -rw-r--r-- | components/drivers/spi/spi_msd.c | 34 | ||||
| -rw-r--r-- | components/drivers/tty/console.c | 2 | ||||
| -rw-r--r-- | components/drivers/usb/usbdevice/class/cdc_vcom.c | 2 | ||||
| -rw-r--r-- | components/drivers/usb/usbdevice/core/usbdevice.c | 4 | ||||
| -rw-r--r-- | components/drivers/usb/usbdevice/core/usbdevice_core.c | 2 | ||||
| -rw-r--r-- | components/drivers/usb/usbhost/core/hub.c | 4 | ||||
| -rw-r--r-- | components/drivers/usb/usbhost/core/usbhost_core.c | 16 | ||||
| -rw-r--r-- | components/utilities/rt-link/src/rtlink_dev.c | 2 | ||||
| -rw-r--r-- | components/utilities/zmodem/rz.c | 2 | ||||
| -rw-r--r-- | components/utilities/zmodem/sz.c | 2 | ||||
| -rw-r--r-- | components/vbus/prio_queue.c | 2 |
15 files changed, 45 insertions, 45 deletions
diff --git a/components/drivers/include/drivers/usb_host.h b/components/drivers/include/drivers/usb_host.h index 95dd1ff066..e3339694e5 100644 --- a/components/drivers/include/drivers/usb_host.h +++ b/components/drivers/include/drivers/usb_host.h @@ -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; diff --git a/components/drivers/ipc/dataqueue.c b/components/drivers/ipc/dataqueue.c index 6b53962384..cd51c3919a 100644 --- a/components/drivers/ipc/dataqueue.c +++ b/components/drivers/ipc/dataqueue.c @@ -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; /* diff --git a/components/drivers/misc/rt_drv_pwm.c b/components/drivers/misc/rt_drv_pwm.c index 25b45f9d43..59f29c8c59 100644 --- a/components/drivers/misc/rt_drv_pwm.c +++ b/components/drivers/misc/rt_drv_pwm.c @@ -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; diff --git a/components/drivers/rtc/alarm.c b/components/drivers/rtc/alarm.c index 56c7430641..0f2d816fec 100644 --- a/components/drivers/rtc/alarm.c +++ b/components/drivers/rtc/alarm.c @@ -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; diff --git a/components/drivers/spi/spi_msd.c b/components/drivers/spi/spi_msd.c index cad7207cd9..2df7c6103f 100644 --- a/components/drivers/spi/spi_msd.c +++ b/components/drivers/spi/spi_msd.c @@ -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. */ diff --git a/components/drivers/tty/console.c b/components/drivers/tty/console.c index 01349635b4..cb7b9049f4 100644 --- a/components/drivers/tty/console.c +++ b/components/drivers/tty/console.c @@ -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; diff --git a/components/drivers/usb/usbdevice/class/cdc_vcom.c b/components/drivers/usb/usbdevice/class/cdc_vcom.c index 29d3e25174..c7097f135c 100644 --- a/components/drivers/usb/usbdevice/class/cdc_vcom.c +++ b/components/drivers/usb/usbdevice/class/cdc_vcom.c @@ -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[] = diff --git a/components/drivers/usb/usbdevice/core/usbdevice.c b/components/drivers/usb/usbdevice/core/usbdevice.c index 0891c0bd26..eaa80217c8 100644 --- a/components/drivers/usb/usbdevice/core/usbdevice.c +++ b/components/drivers/usb/usbdevice/core/usbdevice.c @@ -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(); diff --git a/components/drivers/usb/usbdevice/core/usbdevice_core.c b/components/drivers/usb/usbdevice/core/usbdevice_core.c index 03f231dcef..097c88dcec 100644 --- a/components/drivers/usb/usbdevice/core/usbdevice_core.c +++ b/components/drivers/usb/usbdevice/core/usbdevice_core.c @@ -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; diff --git a/components/drivers/usb/usbhost/core/hub.c b/components/drivers/usb/usbhost/core/hub.c index eca06f6564..21583e016b 100644 --- a/components/drivers/usb/usbhost/core/hub.c +++ b/components/drivers/usb/usbhost/core/hub.c @@ -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); } diff --git a/components/drivers/usb/usbhost/core/usbhost_core.c b/components/drivers/usb/usbhost/core/usbhost_core.c index 71fe3b8b3f..6f570cc784 100644 --- a/components/drivers/usb/usbhost/core/usbhost_core.c +++ b/components/drivers/usb/usbhost/core/usbhost_core.c @@ -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; diff --git a/components/utilities/rt-link/src/rtlink_dev.c b/components/utilities/rt-link/src/rtlink_dev.c index 85d19abd4c..db94e93de3 100644 --- a/components/utilities/rt-link/src/rtlink_dev.c +++ b/components/utilities/rt-link/src/rtlink_dev.c @@ -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) diff --git a/components/utilities/zmodem/rz.c b/components/utilities/zmodem/rz.c index f4fa4bde6c..d6250db3c8 100644 --- a/components/utilities/zmodem/rz.c +++ b/components/utilities/zmodem/rz.c @@ -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 diff --git a/components/utilities/zmodem/sz.c b/components/utilities/zmodem/sz.c index bda5d939d4..504faaa39f 100644 --- a/components/utilities/zmodem/sz.c +++ b/components/utilities/zmodem/sz.c @@ -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) diff --git a/components/vbus/prio_queue.c b/components/vbus/prio_queue.c index dc915ae7d8..9b117eb742 100644 --- a/components/vbus/prio_queue.c +++ b/components/vbus/prio_queue.c @@ -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); |
