Skip to content

Commit

Permalink
r8169: improve rtl8169_rx_fill
Browse files Browse the repository at this point in the history
We have only one user of the error path, so we can inline it.
In addition the call to rtl8169_make_unusable_by_asic() can be removed
because rtl8169_alloc_rx_data() didn't call rtl8169_mark_to_asic() yet
for the respective index if returning NULL.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed Oct 26, 2019
1 parent 7cb83b2 commit e4b5c7a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/net/ethernet/realtek/r8169_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5493,18 +5493,15 @@ static int rtl8169_rx_fill(struct rtl8169_private *tp)

data = rtl8169_alloc_rx_data(tp, tp->RxDescArray + i);
if (!data) {
rtl8169_make_unusable_by_asic(tp->RxDescArray + i);
goto err_out;
rtl8169_rx_clear(tp);
return -ENOMEM;
}
tp->Rx_databuff[i] = data;
}

rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1);
return 0;

err_out:
rtl8169_rx_clear(tp);
return -ENOMEM;
return 0;
}

static int rtl8169_init_ring(struct rtl8169_private *tp)
Expand Down

0 comments on commit e4b5c7a

Please sign in to comment.