Skip to content

Commit fbe5677

Browse files
vcgomesanguy11
authored andcommitted
igc: Simplify setting flags in the TX data descriptor
We can re-use the IGC_SET_FLAG() macro to simplify setting some values in the TX data descriptor. With the macro it's easier to get the meaning of the operations. Signed-off-by: Vinicius Costa Gomes <[email protected]> Tested-by: Naama Meir <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 89cdf9d commit fbe5677

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,14 +1299,12 @@ static void igc_tx_olinfo_status(struct igc_ring *tx_ring,
12991299
u32 olinfo_status = paylen << IGC_ADVTXD_PAYLEN_SHIFT;
13001300

13011301
/* insert L4 checksum */
1302-
olinfo_status |= (tx_flags & IGC_TX_FLAGS_CSUM) *
1303-
((IGC_TXD_POPTS_TXSM << 8) /
1304-
IGC_TX_FLAGS_CSUM);
1302+
olinfo_status |= IGC_SET_FLAG(tx_flags, IGC_TX_FLAGS_CSUM,
1303+
(IGC_TXD_POPTS_TXSM << 8));
13051304

13061305
/* insert IPv4 checksum */
1307-
olinfo_status |= (tx_flags & IGC_TX_FLAGS_IPV4) *
1308-
(((IGC_TXD_POPTS_IXSM << 8)) /
1309-
IGC_TX_FLAGS_IPV4);
1306+
olinfo_status |= IGC_SET_FLAG(tx_flags, IGC_TX_FLAGS_IPV4,
1307+
(IGC_TXD_POPTS_IXSM << 8));
13101308

13111309
tx_desc->read.olinfo_status = cpu_to_le32(olinfo_status);
13121310
}

0 commit comments

Comments
 (0)