From: Sven Van Asbroeck <thesven73@gmail.com>
To: Bryan Whitehead <bryan.whitehead@microchip.com>,
Jakub Kicinski <kuba@kernel.org>,
David S Miller <davem@davemloft.net>
Cc: Sven Van Asbroeck <thesven73@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next v1 1/2] lan743x: clean up software_isr function
Date: Mon, 23 Nov 2020 14:15:28 -0500 [thread overview]
Message-ID: <20201123191529.14908-1-TheSven73@gmail.com> (raw)
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(-)
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)
--
2.17.1
next reply other threads:[~2020-11-23 19:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-23 19:15 Sven Van Asbroeck [this message]
2020-11-23 19:15 ` [PATCH net-next v1 2/2] lan743x: replace polling loop by wait_event_timeout() Sven Van Asbroeck
2020-11-25 0:17 ` [PATCH net-next v1 1/2] lan743x: clean up software_isr function Jakub Kicinski
2020-11-26 14:14 ` Sven Van Asbroeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201123191529.14908-1-TheSven73@gmail.com \
--to=thesven73@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=bryan.whitehead@microchip.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).