Re: [PATCH net-next] r8152: saving the settings of EEE
From: David Miller
Date: Thu Aug 22 2019 - 14:52:50 EST
From: Hayes Wang <hayeswang@xxxxxxxxxxx>
Date: Thu, 22 Aug 2019 16:07:18 +0800
> + if (tp->eee_en) {
> + r8152_eee_en(tp, true);
> + r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, tp->eee_adv);
> + } else {
> + r8152_eee_en(tp, false);
> + r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0);
> + }
I see this same exact code sequence at least 4 times in your patch, please
make a helper function.