.. | .. |
---|
640 | 640 | * figure out where the next TX message starts (and where the |
---|
641 | 641 | * offset to the moved header is). |
---|
642 | 642 | */ |
---|
643 | | - hdr_size = sizeof(*tx_msg) |
---|
644 | | - + le16_to_cpu(tx_msg->num_pls) * sizeof(tx_msg->pld[0]); |
---|
| 643 | + hdr_size = struct_size(tx_msg, pld, le16_to_cpu(tx_msg->num_pls)); |
---|
645 | 644 | hdr_size = ALIGN(hdr_size, I2400M_PL_ALIGN); |
---|
646 | 645 | tx_msg->offset = I2400M_TX_PLD_SIZE - hdr_size; |
---|
647 | 646 | tx_msg_moved = (void *) tx_msg + tx_msg->offset; |
---|
.. | .. |
---|
655 | 654 | padding = aligned_size - tx_msg_moved->size; |
---|
656 | 655 | if (padding > 0) { |
---|
657 | 656 | pad_buf = i2400m_tx_fifo_push(i2400m, padding, 0, 0); |
---|
658 | | - if (unlikely(WARN_ON(pad_buf == NULL |
---|
659 | | - || pad_buf == TAIL_FULL))) { |
---|
| 657 | + if (WARN_ON(pad_buf == NULL || pad_buf == TAIL_FULL)) { |
---|
660 | 658 | /* This should not happen -- append should verify |
---|
661 | 659 | * there is always space left at least to append |
---|
662 | 660 | * tx_block_size */ |
---|