From: RongQing.Li Date: Thu, 5 Apr 2012 09:36:29 +0000 (+0800) Subject: net: replace continue with break to reduce unnecessary loop in xxx_xmarksources X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ce713ee5a10f3a171df94b0d501034aab2388c16;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git net: replace continue with break to reduce unnecessary loop in xxx_xmarksources The conditional which decides to skip inactive filters does not change with the change of loop index, so it is unnecessary to check them many times. Signed-off-by: RongQing.Li Signed-off-by: David S. Miller --- diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 450e5d21ed2a..e9b90a8ca55a 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -775,7 +775,7 @@ static int igmp_xmarksources(struct ip_mc_list *pmc, int nsrcs, __be32 *srcs) if (psf->sf_count[MCAST_INCLUDE] || pmc->sfcount[MCAST_EXCLUDE] != psf->sf_count[MCAST_EXCLUDE]) - continue; + break; if (srcs[i] == psf->sf_inaddr) { scount++; break; diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 16c33e308121..6264d8fd2a2d 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -1061,7 +1061,7 @@ static int mld_xmarksources(struct ifmcaddr6 *pmc, int nsrcs, if (psf->sf_count[MCAST_INCLUDE] || pmc->mca_sfcount[MCAST_EXCLUDE] != psf->sf_count[MCAST_EXCLUDE]) - continue; + break; if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) { scount++; break;