Bug 209635 - usr/src/sys/arm/xscale/ixp425/ixp425_npe.c:695: pointless test ?
Summary: usr/src/sys/arm/xscale/ixp425/ixp425_npe.c:695: pointless test ?
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-19 10:49 UTC by David Binderman
Modified: 2016-05-19 10:49 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2016-05-19 10:49:56 UTC
usr/src/sys/arm/xscale/ixp425/ixp425_npe.c:695]: (style) Unsigned variable 'cNum' can't be negative so it is unnecessary to test it.

Source code is

       if (!(0 <= cNum && cNum < IX_NPEDL_CTXT_NUM_MAX)) {

but

       uint32_t cNum = (addrInfo & IX_NPEDL_MASK_STATE_ADDR_CTXT_NUM) >>
            IX_NPEDL_OFFSET_STATE_ADDR_CTXT_NUM;