From: Ed Spiridonov <edo.rus@gmail.com>
To: mkl@pengutronix.de
Cc: linux-can@vger.kernel.org, celston@katalix.com,
chripell@evolware.org, sbabic@denx.de,
Ed Spiridonov <edo.rus@gmail.com>
Subject: [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary
Date: Fri, 4 Mar 2016 09:07:27 +0300 [thread overview]
Message-ID: <1457071647-17098-1-git-send-email-edo.rus@gmail.com> (raw)
Only two bits (RX0OVR and RX1OVR) are writable in EFLG, write is useless if these bits aren't set.
Signed-off-by: Ed Spiridonov <edo.rus@gmail.com>
---
drivers/net/can/spi/mcp251x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index 575790e..74a7dfe 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -843,7 +843,7 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)
if (clear_intf)
mcp251x_write_bits(spi, CANINTF, clear_intf, 0x00);
- if (eflag)
+ if (eflag & (EFLG_RX0OVR | EFLG_RX1OVR))
mcp251x_write_bits(spi, EFLG, eflag, 0x00);
/* Update can state */
--
2.7.0
next reply other threads:[~2016-03-04 6:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-04 6:07 Ed Spiridonov [this message]
2016-03-04 7:52 ` [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary Marc Kleine-Budde
-- strict thread matches above, loose matches on Subject: below --
2016-03-04 7:55 pull-request: can 2016-03-04 Marc Kleine-Budde
2016-03-04 7:55 ` [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary Marc Kleine-Budde
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=1457071647-17098-1-git-send-email-edo.rus@gmail.com \
--to=edo.rus@gmail.com \
--cc=celston@katalix.com \
--cc=chripell@evolware.org \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=sbabic@denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.