#2685 closed defect (fixed)

c/src/lib/libbsp/arm/atsam/network/if_atsam.c:409: possible bad if statement

Reported by: David Binderman Owned by: Sebastian Huber
Priority: normal Milestone: 5.1
Component: arch/arm Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

rtems/c/src/lib/libbsp/arm/atsam/network/if_atsam.c:409]: (style) Redundant condition: If 'phy <= 0', the comparison 'phy <= 31' is always true.

Source code is

if ((phy <= 0) && (phy <= 31)) {

/*

  • invalid phy number */

Maybe better code

if ((phy <= 0)
(phy >= 31)) {

/*

  • invalid phy number */

Change History (5)

comment:1 Changed on Apr 14, 2016 at 5:52:12 AM by Sebastian Huber

Milestone: 4.11.14.12
Owner: set to Sebastian Huber
Status: newassigned
Version: 4.104.12

comment:2 Changed on Jun 6, 2016 at 11:17:28 AM by Alexander Krutwig <alexander.krutwig@…>

Resolution: fixed
Status: assignedclosed

In 15f0f9b448150f1ac828a9d3e498a7249dbdc362/rtems:

atsam: Fix network interface PHY handling

Close #2685.

comment:3 Changed on May 11, 2017 at 7:31:02 AM by Sebastian Huber

Milestone: 4.124.12.0

comment:4 Changed on Oct 16, 2017 at 6:24:30 AM by Sebastian Huber

Component: unspecifiedarch/arm

comment:5 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.