From 4101e976e0376a1820ae55adf8bca7dda5089a7d Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Tue, 26 Oct 2010 02:20:56 +0000 Subject: 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/) // @@ expression i; @@ *i = ...; i = ...; // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller --- drivers/isdn/hisax/l3_1tr6.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/isdn/hisax') diff --git a/drivers/isdn/hisax/l3_1tr6.c b/drivers/isdn/hisax/l3_1tr6.c index b0554f8..ee4dae1 100644 --- a/drivers/isdn/hisax/l3_1tr6.c +++ b/drivers/isdn/hisax/l3_1tr6.c @@ -164,11 +164,9 @@ l3_1tr6_setup(struct l3_process *pc, u_char pr, void *arg) char tmp[80]; struct sk_buff *skb = arg; - p = skb->data; - /* Channel Identification */ - p = skb->data; - if ((p = findie(p, skb->len, WE0_chanID, 0))) { + p = findie(skb->data, skb->len, WE0_chanID, 0); + if (p) { if (p[1] != 1) { l3_1tr6_error(pc, "setup wrong chanID len", skb); return; -- cgit v1.1