Changeset 132ab5d1 in mainline for uspace/lib/usbhid/src


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

Location:
uspace/lib/usbhid/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhid/src/hiddescriptor.c

    r8bfb163 r132ab5d1  
    3636#include <errno.h>
    3737#include <stdio.h>
    38 #include <malloc.h>
    3938#include <mem.h>
    4039#include <usb/debug.h>
    4140#include <assert.h>
     41#include <stdlib.h>
    4242
    4343
     
    7575#define USB_HID_RESET_OFFSET    3
    7676
     77#define USB_HID_INVALID                 -98
    7778/** Unknown tag was founded in report descriptor data*/
    7879#define USB_HID_UNKNOWN_TAG             -99
     
    103104               
    104105                if(usb_hid_report_compare_usage_path(path, cmp_path,
    105                                         USB_HID_PATH_COMPARE_STRICT) == EOK){
     106                                        USB_HID_PATH_COMPARE_STRICT) == 0){
    106107                        break;
    107108                }
     
    539540
    540541                if((ret=usb_hid_report_parse_main_tag(tag, data, item_size,
    541                         report_item, usage_path)) == EOK) {
     542                        report_item, usage_path)) == 0) {
    542543
    543544                        return USB_HID_NEW_REPORT_ITEM;
     
    570571 * @param Length of data buffer
    571572 * @param Current state table
    572  * @return Error code
     573 * @return 0 or USB_HID_ code
    573574 */
    574575
     
    585586        case USB_HID_REPORT_TAG_FEATURE:
    586587                report_item->item_flags = *data;                       
    587                 return EOK;                     
     588                return 0;                       
    588589                break;
    589590                       
     
    625626        }
    626627
    627         return EOK;
     628        return 0;
    628629}
    629630
     
    635636 * @param Length of data buffer
    636637 * @param Current state table
    637  * @return Error code
     638 * @return 0 or USB_HID_ code
    638639 */
    639640int usb_hid_report_parse_global_tag(uint8_t tag, const uint8_t *data,
     
    711712        }
    712713
    713         return EOK;
     714        return 0;
    714715}
    715716
     
    721722 * @param Length of data buffer
    722723 * @param Current state table
    723  * @return Error code
     724 * @return 0 or USB_HID_ code
    724725 */
    725726int usb_hid_report_parse_local_tag(uint8_t tag, const uint8_t *data,
     
    777778                            USB_HID_EXTENDED_USAGE_PAGE(
    778779                            usb_hid_report_tag_data_uint32(data, item_size))) {
    779                                 return EINVAL;
     780                                return USB_HID_INVALID;
    780781                        }
    781782                       
     
    848849        }
    849850       
    850         return EOK;
     851        return 0;
    851852}
    852853
  • uspace/lib/usbhid/src/hidparser.c

    r8bfb163 r132ab5d1  
    3636#include <errno.h>
    3737#include <stdio.h>
    38 #include <malloc.h>
     38#include <stdlib.h>
    3939#include <mem.h>
    4040#include <usb/debug.h>
     
    518518
    519519                        if (usb_hid_report_compare_usage_path(
    520                             field->collection_path, path, flags) == EOK) {
     520                            field->collection_path, path, flags) == 0) {
    521521                                usb_hid_report_remove_last_item(
    522522                                    field->collection_path);
  • uspace/lib/usbhid/src/hidpath.c

    r8bfb163 r132ab5d1  
    3636#include <errno.h>
    3737#include <stdio.h>
    38 #include <malloc.h>
    3938#include <mem.h>
     39#include <stdlib.h>
    4040#include <usb/debug.h>
    4141#include <assert.h>
     
    191191 * @param flags       Flags determining the mode of comparison
    192192 *
    193  * @return EOK if both paths are identical, non zero number otherwise
     193 * @return 0 if both paths are identical, non zero number otherwise
    194194 *
    195195 */
     
    213213        // Empty path match all others
    214214        if (path->depth == 0) {
    215                 return EOK;
     215                return 0;
    216216        }
    217217       
     
    239239                                        if (USB_HID_SAME_USAGE(report_item->usage,
    240240                                            path_item->usage))
    241                                                 return EOK;
     241                                                return 0;
    242242                                } else {
    243                                         return EOK;
     243                                        return 0;
    244244                                }
    245245                        }
     
    285285                    ((report_link == &report_path->items.head) &&
    286286                    (path_link == &path->items.head))) {
    287                         return EOK;
     287                        return 0;
    288288                } else {
    289289                        return 1;
     
    297297               
    298298                if (list_empty(&path->items)) {
    299                         return EOK;
     299                        return 0;
    300300                }
    301301               
     
    320320               
    321321                if (path_link == &path->items.head) {
    322                         return EOK;
     322                        return 0;
    323323                } else {
    324324                        return 1;
     
    327327       
    328328        default:
    329                 return EINVAL;
     329                return -1;
    330330        }
    331331}
Note: See TracChangeset for help on using the changeset viewer.