Bug 210099 - Remove redundant MPASS which always evaluates to true in kern/subr_sleepqueue.c
Summary: Remove redundant MPASS which always evaluates to true in kern/subr_sleepqueue.c
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-06-07 12:50 UTC by Bulat
Modified: 2017-03-22 16:46 UTC (History)
1 user (show)

See Also:


Attachments
Remove line of redundant always-true MPASS check. (42 bytes, patch)
2016-06-07 12:50 UTC, Bulat
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bulat 2016-06-07 12:50:10 UTC
Created attachment 171141 [details]
Remove line of redundant always-true MPASS check.

Remove MPASS(wchan == sq->sq_wchan) as there is invariant that return value(sq) returned from sleepq_lookup, if not null, has sq->wchan = wchan where wchan is the parameter passed to sleepq_lookup.
Comment 1 Bulat 2016-06-07 12:51:38 UTC
File: kern/subr_sleepqueue.c
File revision: r300109
Comment 2 John Baldwin freebsd_committer freebsd_triage 2017-03-22 16:46:12 UTC
The purpose of an assertion is to ensure that it the code is doing what is expected.  In particular in this case the assertion is verifying that sleepq_lookup() did in fact return a sleepqueue with a matching wait channel.