Changes in / [e18e0d6:55e388a1] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/hidparser.c

    re18e0d6 r55e388a1  
    8484{
    8585   if(parser == NULL) {
    86         return -1;
     86        return EINVAL;
    8787   }
    8888
     
    115115        size_t offset_output=0;
    116116        size_t offset_feature=0;
     117
     118        if(usb_hid_parser_init(parser) != EOK) {
     119                return EINVAL;
     120        }
    117121       
    118122
     
    128132
    129133                        if((i+USB_HID_ITEM_SIZE(data[i]))>= size){
    130                                 return -1; // TODO ERROR CODE
     134                                return EINVAL; // TODO ERROR CODE
    131135                        }
    132136                       
     
    530534void usb_hid_descriptor_print(usb_hid_report_parser_t *parser)
    531535{
     536        if(parser == NULL) {
     537                return;
     538        }
     539       
    532540        usb_log_debug("INPUT:\n");
    533541        usb_hid_descriptor_print_list(&parser->input);
     
    615623        size_t j=0;
    616624
     625        if(parser == NULL) {
     626                return EINVAL;
     627        }
     628
     629       
    617630        // get the size of result keycodes array
    618631        usb_hid_report_path_t path;
     
    737750int usb_hid_report_input_length(const usb_hid_report_parser_t *parser,
    738751        const usb_hid_report_path_t *path)
    739 {
     752{       
    740753        int ret = 0;
    741754        link_t *item;
    742755        usb_hid_report_item_t *report_item;
    743756
     757        if(parser == NULL) {
     758                return EINVAL;
     759        }
     760       
    744761        item = (&parser->input)->next;
    745762        while(&parser->input != item) {
Note: See TracChangeset for help on using the changeset viewer.