Skip to content

Commit c82e648

Browse files
jbrandebanguy11
authored andcommitted
igc: field prep conversion
Refactor igc driver to use FIELD_PREP(), which reduces lines of code and adds clarity of intent. This code was generated by the following coccinelle/spatch script and then manually repaired in a later patch. @prep2@ constant shift,mask; type T; expression a; @@ -(((T)(a) << shift) & mask) +FIELD_PREP(mask, a) @prep@ constant shift,mask; type T; expression a; @@ -((T)((a) << shift) & mask) +FIELD_PREP(mask, a) Cc: Julia Lawall <[email protected]> Cc: Sasha Neftin <[email protected]> Reviewed-by: Marcin Szycik <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Jesse Brandeburg <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 7173be2 commit c82e648

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3452,8 +3452,8 @@ static int igc_write_flex_filter_ll(struct igc_adapter *adapter,
34523452

34533453
/* Configure filter */
34543454
queuing = input->length & IGC_FHFT_LENGTH_MASK;
3455-
queuing |= (input->rx_queue << IGC_FHFT_QUEUE_SHIFT) & IGC_FHFT_QUEUE_MASK;
3456-
queuing |= (input->prio << IGC_FHFT_PRIO_SHIFT) & IGC_FHFT_PRIO_MASK;
3455+
queuing |= FIELD_PREP(IGC_FHFT_QUEUE_MASK, input->rx_queue);
3456+
queuing |= FIELD_PREP(IGC_FHFT_PRIO_MASK, input->prio);
34573457

34583458
if (input->immediate_irq)
34593459
queuing |= IGC_FHFT_IMM_INT;

0 commit comments

Comments
 (0)