Commit 4101e976 authored by Julia Lawall's avatar Julia Lawall Committed by David S. Miller

drivers/isdn: delete double assignment

Delete successive assignments to the same location.  In the first case, the
hscx array has two elements, so change the assignment to initialize the
second one.  In the second case, the two assignments are simply identical.
Furthermore, neither is necessary, because the effect of the assignment is
only visible in the next line, in the assignment in the if test.  The patch
inlines the right hand side value in the latter assignment and pulls that
assignment out of the if test.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 13c3ab86
...@@ -563,7 +563,7 @@ reset_inf(struct inf_hw *hw) ...@@ -563,7 +563,7 @@ reset_inf(struct inf_hw *hw)
mdelay(10); mdelay(10);
hw->ipac.isac.adf2 = 0x87; hw->ipac.isac.adf2 = 0x87;
hw->ipac.hscx[0].slot = 0x1f; hw->ipac.hscx[0].slot = 0x1f;
hw->ipac.hscx[0].slot = 0x23; hw->ipac.hscx[1].slot = 0x23;
break; break;
case INF_GAZEL_R753: case INF_GAZEL_R753:
val = inl((u32)hw->cfg.start + GAZEL_CNTRL); val = inl((u32)hw->cfg.start + GAZEL_CNTRL);
......
...@@ -164,11 +164,9 @@ l3_1tr6_setup(struct l3_process *pc, u_char pr, void *arg) ...@@ -164,11 +164,9 @@ l3_1tr6_setup(struct l3_process *pc, u_char pr, void *arg)
char tmp[80]; char tmp[80];
struct sk_buff *skb = arg; struct sk_buff *skb = arg;
p = skb->data;
/* Channel Identification */ /* Channel Identification */
p = skb->data; p = findie(skb->data, skb->len, WE0_chanID, 0);
if ((p = findie(p, skb->len, WE0_chanID, 0))) { if (p) {
if (p[1] != 1) { if (p[1] != 1) {
l3_1tr6_error(pc, "setup wrong chanID len", skb); l3_1tr6_error(pc, "setup wrong chanID len", skb);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment