master/domain.c
changeset 782 9964e7be79ce
parent 719 03d5b96632fb
child 783 0e16f97cf752
equal deleted inserted replaced
781:9736efaac5d5 782:9964e7be79ce
   198     const ec_pdo_entry_t *other_entry;
   198     const ec_pdo_entry_t *other_entry;
   199     unsigned int bit_offset, byte_offset;
   199     unsigned int bit_offset, byte_offset;
   200 
   200 
   201     // Calculate offset (in sync manager) for process data pointer
   201     // Calculate offset (in sync manager) for process data pointer
   202     bit_offset = 0;
   202     bit_offset = 0;
   203     byte_offset = 0;
       
   204     list_for_each_entry(other_pdo, &sync->pdos, list) {
   203     list_for_each_entry(other_pdo, &sync->pdos, list) {
   205         list_for_each_entry(other_entry, &other_pdo->entries, list) {
   204         list_for_each_entry(other_entry, &other_pdo->entries, list) {
   206             if (other_entry == entry) {
   205             if (other_entry == entry)
   207                 byte_offset = bit_offset / 8;
   206                 goto out;
   208                 break;
       
   209             }
       
   210             bit_offset += other_entry->bit_length;
   207             bit_offset += other_entry->bit_length;
   211         }
   208         }
   212     }
   209     }
       
   210 out:
       
   211     byte_offset = bit_offset / 8;
   213 
   212 
   214     // Allocate memory for data registration object
   213     // Allocate memory for data registration object
   215     if (!(data_reg =
   214     if (!(data_reg =
   216           (ec_data_reg_t *) kmalloc(sizeof(ec_data_reg_t), GFP_KERNEL))) {
   215           (ec_data_reg_t *) kmalloc(sizeof(ec_data_reg_t), GFP_KERNEL))) {
   217         EC_ERR("Failed to allocate data registration.\n");
   216         EC_ERR("Failed to allocate data registration.\n");