Changeset 7837101e in mainline for uspace/srv/net/il/arp/arp.c


Ignore:
Timestamp:
2010-12-16T16:58:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b59023
Parents:
7bdcc45
Message:

Get rid of superfluous uses of CONVERT_SIZE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/arp/arp.c

    r7bdcc45 r7837101e  
    483483        des_proto = des_hw + header->hardware_length;
    484484        trans = arp_addr_find(&proto->addresses, (char *) src_proto,
    485             CONVERT_SIZE(uint8_t, char, header->protocol_length));
     485            header->protocol_length);
    486486        /* Exists? */
    487487        if (trans && trans->hw_addr) {
    488                 if (trans->hw_addr->length != CONVERT_SIZE(uint8_t, char,
    489                     header->hardware_length)) {
     488                if (trans->hw_addr->length != header->hardware_length)
    490489                        return EINVAL;
    491                 }
    492490                memcpy(trans->hw_addr->value, src_hw, trans->hw_addr->length);
    493491        }
    494492        /* Is my protocol address? */
    495         if (proto->addr->length != CONVERT_SIZE(uint8_t, char,
    496             header->protocol_length)) {
     493        if (proto->addr->length != header->protocol_length)
    497494                return EINVAL;
    498         }
    499495        if (!str_lcmp(proto->addr->value, (char *) des_proto,
    500496            proto->addr->length)) {
     
    507503                        fibril_condvar_initialize(&trans->cv);
    508504                        rc = arp_addr_add(&proto->addresses, (char *) src_proto,
    509                             CONVERT_SIZE(uint8_t, char, header->protocol_length),
    510                             trans);
     505                            header->protocol_length, trans);
    511506                        if (rc != EOK) {
    512507                                /* The generic char map has already freed trans! */
     
    516511                if (!trans->hw_addr) {
    517512                        trans->hw_addr = measured_string_create_bulk(
    518                             (char *) src_hw, CONVERT_SIZE(uint8_t, char,
    519                             header->hardware_length));
     513                            (char *) src_hw, header->hardware_length);
    520514                        if (!trans->hw_addr)
    521515                                return ENOMEM;
     
    606600
    607601        /* ARP packet content size = header + (address + translation) * 2 */
    608         length = 8 + 2 * (CONVERT_SIZE(char, uint8_t, proto->addr->length) +
    609             CONVERT_SIZE(char, uint8_t, device->addr->length));
     602        length = 8 + 2 * (proto->addr->length + device->addr->length);
    610603        if (length > device->packet_dimension.content)
    611604                return ELIMIT;
     
    640633
    641634        rc = packet_set_addr(packet, (uint8_t *) device->addr->value,
    642             (uint8_t *) device->broadcast_addr->value,
    643             CONVERT_SIZE(char, uint8_t, device->addr->length));
     635            (uint8_t *) device->broadcast_addr->value, device->addr->length);
    644636        if (rc != EOK) {
    645637                pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
Note: See TracChangeset for help on using the changeset viewer.