Ignore:
Timestamp:
2013-09-10T16:32:35Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4982d87
Parents:
e8d6ce2
Message:

Simplify use of list_foreach.

File:
1 edited

Legend:

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

    re8d6ce2 rfeeac0d  
    333333        }
    334334
    335         usb_hid_report_description_t *report_des = NULL;
    336        
    337         list_foreach(report->reports, report_it) {
    338                 report_des = list_get_instance(report_it,
    339                                 usb_hid_report_description_t, reports_link);
    340 
     335        list_foreach(report->reports, reports_link,
     336            usb_hid_report_description_t, report_des) {
    341337                // if report id not set, return the first of the type
    342338                if(((report_des->report_id == report_id) || (report_id == 0)) &&
     
    902898void usb_hid_descriptor_print_list(list_t *list)
    903899{
    904         usb_hid_report_field_t *report_item;
    905 
    906900        if(list == NULL || list_empty(list)) {
    907901            usb_log_debug("\tempty\n");
     
    909903        }
    910904
    911         list_foreach(*list, item) {
    912                 report_item = list_get_instance(item, usb_hid_report_field_t,
    913                                 ritems_link);
    914 
     905        list_foreach(*list, ritems_link, usb_hid_report_field_t,
     906            report_item) {
    915907                usb_log_debug("\t\tOFFSET: %X\n", report_item->offset);
    916908                usb_log_debug("\t\tSIZE: %zu\n", report_item->size);
     
    937929
    938930                usb_log_debug("\n");
    939 
    940         }
    941 
     931        }
    942932}
    943933
     
    951941void usb_hid_descriptor_print(usb_hid_report_t *report)
    952942{
    953         if(report == NULL) {
     943        if (report == NULL)
    954944                return;
    955         }
    956 
    957         usb_hid_report_description_t *report_des;
    958 
    959         list_foreach(report->reports, report_it) {
    960                 report_des = list_get_instance(report_it,
    961                         usb_hid_report_description_t, reports_link);
     945
     946        list_foreach(report->reports, reports_link,
     947            usb_hid_report_description_t, report_des) {
    962948                usb_log_debug("Report ID: %d\n", report_des->report_id);
    963949                usb_log_debug("\tType: %d\n", report_des->type);
Note: See TracChangeset for help on using the changeset viewer.