Project

General

Profile

Bug #3078

sys/netinet6/nd6_nbr.c: 2 * redundant condition ?

Added by dcb 8 days ago. Updated 8 days ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Target version:
-
Start date:
10/11/2017
Due date:
% Done:

0%


Description

dragonfly/sys/netinet6/nd6_nbr.c:290]: (style) Redundant condition: cmpifp==rtifp. 'cmpifp!=rtifp || (cmpifp==rtifp && (m->m_flags&M_MCAST)==0)' is equivalent to 'cmpifp!=rtifp || (m->m_flags&M_MCAST)==0'

Source code is

if (rt != NULL &&
(cmpifp != rtifp ||
(cmpifp == rtifp && (m->m_flags & M_MCAST) == 0))

[dragonfly/sys/netinet6/nd6_nbr.c:787]: (style) Redundant condition: !is_override. 'is_override || (!is_override && lladdr&&!llchange)' is equivalent to 'is_override || lladdr&&!llchange'

Source code is

} else if (is_override /* (2a) */
|| (!is_override && (lladdr && !llchange)) /* (2b) */
|| !lladdr) { /* (2c) */

History

#1 Updated by swildner 8 days ago

  • Status changed from New to Closed

I've fixed those and a couple of other "Redundant condition: ... is equivalent to ..." from cppcheck.

Also available in: Atom PDF