[NETFILTER]: Remove useless comparisons before assignments
authorJan Engelhardt <jengelh@gmx.de>
Wed, 7 Feb 2007 23:06:43 +0000 (15:06 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 8 Feb 2007 20:39:11 +0000 (12:39 -0800)
Remove unnecessary if() constructs before assignment.

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/netfilter/ip6t_HL.c
net/netfilter/xt_CLASSIFY.c
net/netfilter/xt_CONNMARK.c
net/netfilter/xt_CONNSECMARK.c
net/netfilter/xt_MARK.c
net/netfilter/xt_SECMARK.c

index 435750f664dd13038ec83c678865ab865f26dff3..7e5d51386f5686a42d121612a8855961c1a11275 100644 (file)
@@ -52,8 +52,7 @@ static unsigned int ip6t_hl_target(struct sk_buff **pskb,
                        break;
        }
 
-       if (new_hl != ip6h->hop_limit)
-               ip6h->hop_limit = new_hl;
+       ip6h->hop_limit = new_hl;
 
        return IP6T_CONTINUE;
 }
index 50de965bb1043093d06ab11dcfefab81dc5f5df2..195e92990da77a159fe32f7f2450d516b1cf9497 100644 (file)
@@ -33,9 +33,7 @@ target(struct sk_buff **pskb,
 {
        const struct xt_classify_target_info *clinfo = targinfo;
 
-       if ((*pskb)->priority != clinfo->priority)
-               (*pskb)->priority = clinfo->priority;
-
+       (*pskb)->priority = clinfo->priority;
        return XT_CONTINUE;
 }
 
index 0534bfa65cce290d5aed268d68af2be33f8c5b08..795c058b16a5bbd2dbf6c5b1273256d73ab8b1fa 100644 (file)
@@ -61,7 +61,7 @@ target(struct sk_buff **pskb,
 #else
                                nf_conntrack_event_cache(IPCT_MARK, *pskb);
 #endif
-               }
+                       }
                        break;
                case XT_CONNMARK_SAVE:
                        newmark = (*ctmark & ~markinfo->mask) |
@@ -78,8 +78,7 @@ target(struct sk_buff **pskb,
                case XT_CONNMARK_RESTORE:
                        mark = (*pskb)->mark;
                        diff = (*ctmark ^ mark) & markinfo->mask;
-                       if (diff != 0)
-                               (*pskb)->mark = mark ^ diff;
+                       (*pskb)->mark = mark ^ diff;
                        break;
                }
        }
index a3fe3c334b09efa268198ab32cb6960605e33597..1ab0db641f9641b97398c806668a760b5a5bab7c 100644 (file)
@@ -41,8 +41,7 @@ static void secmark_save(struct sk_buff *skb)
 
                connsecmark = nf_ct_get_secmark(skb, &ctinfo);
                if (connsecmark && !*connsecmark)
-                       if (*connsecmark != skb->secmark)
-                               *connsecmark = skb->secmark;
+                       *connsecmark = skb->secmark;
        }
 }
 
@@ -58,8 +57,7 @@ static void secmark_restore(struct sk_buff *skb)
 
                connsecmark = nf_ct_get_secmark(skb, &ctinfo);
                if (connsecmark && *connsecmark)
-                       if (skb->secmark != *connsecmark)
-                               skb->secmark = *connsecmark;
+                       skb->secmark = *connsecmark;
        }
 }
 
index 0b48547e8d64bb0a2e41998733713a1b51730196..cfc45af357d50146034fcc052d48a7ba4eb8cf96 100644 (file)
@@ -31,9 +31,7 @@ target_v0(struct sk_buff **pskb,
 {
        const struct xt_mark_target_info *markinfo = targinfo;
 
-       if((*pskb)->mark != markinfo->mark)
-               (*pskb)->mark = markinfo->mark;
-
+       (*pskb)->mark = markinfo->mark;
        return XT_CONTINUE;
 }
 
@@ -62,9 +60,7 @@ target_v1(struct sk_buff **pskb,
                break;
        }
 
-       if((*pskb)->mark != mark)
-               (*pskb)->mark = mark;
-
+       (*pskb)->mark = mark;
        return XT_CONTINUE;
 }
 
index add752196290d8c44cce0a54f4fa9de0eccff8c1..f1131c3a9db5bcfd174911b45336d7aa3052621a 100644 (file)
@@ -47,9 +47,7 @@ static unsigned int target(struct sk_buff **pskb, const struct net_device *in,
                BUG();
        }
 
-       if ((*pskb)->secmark != secmark)
-               (*pskb)->secmark = secmark;
-
+       (*pskb)->secmark = secmark;
        return XT_CONTINUE;
 }