Changeset feeac0d in mainline for uspace/drv


Ignore:
Timestamp:
2013-09-10T16:32:35Z (12 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.

Location:
uspace/drv/bus/usb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbmid/explore.c

    re8d6ce2 rfeeac0d  
    5656static bool interface_in_list(const list_t *list, int interface_no)
    5757{
    58         list_foreach(*list, l) {
    59                 usbmid_interface_t *iface = usbmid_interface_from_link(l);
     58        list_foreach(*list, link, usbmid_interface_t, iface) {
    6059                if (iface->interface_no == interface_no) {
    6160                        return true;
     
    190189
    191190        /* Start child function for every interface. */
    192         list_foreach(usb_mid->interface_list, link) {
    193                 usbmid_interface_t *iface = usbmid_interface_from_link(link);
    194 
     191        list_foreach(usb_mid->interface_list, link, usbmid_interface_t, iface) {
    195192                usb_log_info("Creating child for interface %d (%s).\n",
    196193                    iface->interface_no,
  • uspace/drv/bus/usb/usbmid/usbmid.c

    re8d6ce2 rfeeac0d  
    135135        }
    136136
    137         list_foreach(match_ids.ids, link) {
    138                 match_id_t *match_id = list_get_instance(link, match_id_t, link);
     137        list_foreach(match_ids.ids, link, match_id_t, match_id) {
    139138                rc = ddf_fun_add_match_id(child, match_id->id, match_id->score);
    140139                if (rc != EOK) {
  • uspace/drv/bus/usb/vhc/transfer.c

    re8d6ce2 rfeeac0d  
    9292
    9393        bool target_found = false;
    94         list_foreach(vhc->devices, pos) {
    95                 vhc_virtdev_t *dev = list_get_instance(pos, vhc_virtdev_t, link);
     94        list_foreach(vhc->devices, link, vhc_virtdev_t, dev) {
    9695                fibril_mutex_lock(&dev->guard);
    9796                if (dev->address == transfer->address) {
Note: See TracChangeset for help on using the changeset viewer.