diff mbox series

[net-next,v1,1/2] lan743x: clean up software_isr function

Message ID 20201123191529.14908-1-TheSven73@gmail.com
State New
Headers show
Series [net-next,v1,1/2] lan743x: clean up software_isr function | expand

Commit Message

Sven Van Asbroeck Nov. 23, 2020, 7:15 p.m. UTC
From: Sven Van Asbroeck <thesven73@gmail.com>

For no apparent reason, this function reads the INT_STS register, and
checks if the software interrupt bit is set. These things have already
been carried out by this function's only caller.

Clean up by removing the redundant code.

Tested-by: Sven Van Asbroeck <thesven73@gmail.com> # lan7430
Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com>
---

Tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git # f9e425e99b07

To: Bryan Whitehead <bryan.whitehead@microchip.com>
To: Jakub Kicinski <kuba@kernel.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

 drivers/net/ethernet/microchip/lan743x_main.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Comments

Jakub Kicinski Nov. 25, 2020, 12:17 a.m. UTC | #1
On Mon, 23 Nov 2020 14:15:28 -0500 Sven Van Asbroeck wrote:
> From: Sven Van Asbroeck <thesven73@gmail.com>

> 

> For no apparent reason, this function reads the INT_STS register, and

> checks if the software interrupt bit is set. These things have already

> been carried out by this function's only caller.

> 

> Clean up by removing the redundant code.

> 

> Tested-by: Sven Van Asbroeck <thesven73@gmail.com> # lan7430

> Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com>


Applied both, thank you!
Sven Van Asbroeck Nov. 26, 2020, 2:14 p.m. UTC | #2
On Tue, Nov 24, 2020 at 7:17 PM Jakub Kicinski <kuba@kernel.org> wrote:
>

> Applied both, thank you!


Thank you Jakub !
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index 87b6c59a1e03..bdc80098c240 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -140,18 +140,13 @@  static int lan743x_csr_init(struct lan743x_adapter *adapter)
 	return result;
 }
 
-static void lan743x_intr_software_isr(void *context)
+static void lan743x_intr_software_isr(struct lan743x_adapter *adapter)
 {
-	struct lan743x_adapter *adapter = context;
 	struct lan743x_intr *intr = &adapter->intr;
-	u32 int_sts;
 
-	int_sts = lan743x_csr_read(adapter, INT_STS);
-	if (int_sts & INT_BIT_SW_GP_) {
-		/* disable the interrupt to prevent repeated re-triggering */
-		lan743x_csr_write(adapter, INT_EN_CLR, INT_BIT_SW_GP_);
-		intr->software_isr_flag = 1;
-	}
+	/* disable the interrupt to prevent repeated re-triggering */
+	lan743x_csr_write(adapter, INT_EN_CLR, INT_BIT_SW_GP_);
+	intr->software_isr_flag = 1;
 }
 
 static void lan743x_tx_isr(void *context, u32 int_sts, u32 flags)