netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull-request: can: 2012-06-15
@ 2012-06-15 10:20 Marc Kleine-Budde
  2012-06-15 10:20 ` [PATCH] can: c_can: precedence error in c_can_chip_config() Marc Kleine-Budde
  2012-06-15 22:26 ` pull-request: can: 2012-06-15 David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2012-06-15 10:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-can

Hello David,

here is a patch intended for v3.5, targeting net/master.

Dan Carpenter found a precedence error in c_can_chip_config() function
in the c_can driver, preventing that listen only + loop back mode can be
activated.

regards,
Marc


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] can: c_can: precedence error in c_can_chip_config()
  2012-06-15 10:20 pull-request: can: 2012-06-15 Marc Kleine-Budde
@ 2012-06-15 10:20 ` Marc Kleine-Budde
  2012-06-15 22:26   ` David Miller
  2012-06-15 22:26 ` pull-request: can: 2012-06-15 David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2012-06-15 10:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-can, Dan Carpenter, Marc Kleine-Budde

From: Dan Carpenter <dan.carpenter@oracle.com>

(CAN_CTRLMODE_LISTENONLY & CAN_CTRLMODE_LOOPBACK) is (0x02 & 0x01) which
is zero so the condition is never true.  The intent here was to test
that both flags were set.

Cc: <stable@kernel.org> # 2.6.39+
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/c_can/c_can.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 8dc84d6..86cd532 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -590,8 +590,8 @@ static void c_can_chip_config(struct net_device *dev)
 	priv->write_reg(priv, &priv->regs->control,
 			CONTROL_ENABLE_AR);
 
-	if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY &
-					CAN_CTRLMODE_LOOPBACK)) {
+	if ((priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY) &&
+	    (priv->can.ctrlmode & CAN_CTRLMODE_LOOPBACK)) {
 		/* loopback + silent mode : useful for hot self-test */
 		priv->write_reg(priv, &priv->regs->control, CONTROL_EIE |
 				CONTROL_SIE | CONTROL_IE | CONTROL_TEST);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] can: c_can: precedence error in c_can_chip_config()
  2012-06-15 10:20 ` [PATCH] can: c_can: precedence error in c_can_chip_config() Marc Kleine-Budde
@ 2012-06-15 22:26   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-06-15 22:26 UTC (permalink / raw)
  To: mkl; +Cc: netdev, linux-can, dan.carpenter

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri, 15 Jun 2012 12:20:44 +0200

> From: Dan Carpenter <dan.carpenter@oracle.com>
> 
> (CAN_CTRLMODE_LISTENONLY & CAN_CTRLMODE_LOOPBACK) is (0x02 & 0x01) which
> is zero so the condition is never true.  The intent here was to test
> that both flags were set.
> 
> Cc: <stable@kernel.org> # 2.6.39+
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: pull-request: can: 2012-06-15
  2012-06-15 10:20 pull-request: can: 2012-06-15 Marc Kleine-Budde
  2012-06-15 10:20 ` [PATCH] can: c_can: precedence error in c_can_chip_config() Marc Kleine-Budde
@ 2012-06-15 22:26 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2012-06-15 22:26 UTC (permalink / raw)
  To: mkl; +Cc: netdev, linux-can

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri, 15 Jun 2012 12:20:43 +0200

> Hello David,
> 
> here is a patch intended for v3.5, targeting net/master.
> 
> Dan Carpenter found a precedence error in c_can_chip_config() function
> in the c_can driver, preventing that listen only + loop back mode can be
> activated.

It's not a pull request if you don't give me a GIT url to pull from.
:-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-15 22:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-15 10:20 pull-request: can: 2012-06-15 Marc Kleine-Budde
2012-06-15 10:20 ` [PATCH] can: c_can: precedence error in c_can_chip_config() Marc Kleine-Budde
2012-06-15 22:26   ` David Miller
2012-06-15 22:26 ` pull-request: can: 2012-06-15 David Miller

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).