projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
424d54d
)
can: c_can: precedence error in c_can_chip_config()
author
Dan Carpenter
<
[email protected]
>
Fri, 15 Jun 2012 00:20:44 +0000
(
00:20
+0000)
committer
David S. Miller
<
[email protected]
>
Fri, 15 Jun 2012 22:25:56 +0000
(15:25 -0700)
(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: <
[email protected]
> # 2.6.39+
Signed-off-by: Dan Carpenter <
[email protected]
>
Acked-by: Oliver Hartkopp <
[email protected]
>
Signed-off-by: Marc Kleine-Budde <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/can/c_can/c_can.c
patch
|
blob
|
history
diff --git
a/drivers/net/can/c_can/c_can.c
b/drivers/net/can/c_can/c_can.c
index 8dc84d66eea1b446b66b7c8a12f394abba619d57..86cd532c78f90f9e4f42e8e795f2b8f1423cf424 100644
(file)
--- 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);