hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/net/wimax/i2400m/tx.c
....@@ -640,8 +640,7 @@
640640 * figure out where the next TX message starts (and where the
641641 * offset to the moved header is).
642642 */
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));
645644 hdr_size = ALIGN(hdr_size, I2400M_PL_ALIGN);
646645 tx_msg->offset = I2400M_TX_PLD_SIZE - hdr_size;
647646 tx_msg_moved = (void *) tx_msg + tx_msg->offset;
....@@ -655,8 +654,7 @@
655654 padding = aligned_size - tx_msg_moved->size;
656655 if (padding > 0) {
657656 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)) {
660658 /* This should not happen -- append should verify
661659 * there is always space left at least to append
662660 * tx_block_size */