* [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary
@ 2016-03-04 6:07 Ed Spiridonov
2016-03-04 7:52 ` Marc Kleine-Budde
0 siblings, 1 reply; 3+ messages in thread
From: Ed Spiridonov @ 2016-03-04 6:07 UTC (permalink / raw)
To: mkl; +Cc: linux-can, celston, chripell, sbabic, Ed Spiridonov
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary
2016-03-04 6:07 [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary Ed Spiridonov
@ 2016-03-04 7:52 ` Marc Kleine-Budde
0 siblings, 0 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2016-03-04 7:52 UTC (permalink / raw)
To: Ed Spiridonov; +Cc: linux-can, celston, chripell, sbabic
[-- Attachment #1.1: Type: text/plain, Size: 515 bytes --]
On 03/04/2016 07:07 AM, Ed Spiridonov wrote:
> 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>
Added to can.
Thanks,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary
2016-03-04 7:55 pull-request: can 2016-03-04 Marc Kleine-Budde
@ 2016-03-04 7:55 ` Marc Kleine-Budde
0 siblings, 0 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2016-03-04 7:55 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-can, kernel, Ed Spiridonov, Marc Kleine-Budde
From: Ed Spiridonov <edo.rus@gmail.com>
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>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
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 575790e8a75a..74a7dfecee27 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-04 7:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-04 6:07 [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary Ed Spiridonov
2016-03-04 7:52 ` 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
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).