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: Closed Overcome By Events
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: 2021-03-01 18:01 UTC (History)
1 user (show)

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;
Comment 1 Mitchell Horne freebsd_committer freebsd_triage 2021-03-01 18:01:09 UTC
Hi,

Unfortunately, it seems this was never looked at. However, this driver is no longer present in the tree. It was removed with big-endian arm support in:

https://cgit.freebsd.org/src/commit/?id=ff9452772d2fbb1268af844ff4c0980942046546

For what it's worth, your analysis seems correct. Closing now as there is nothing more to be done.