Avoid re-check of usermode condition.
ClosedPublic

Authored by kib on Mon, Jan 1, 7:54 PM.

Details

Summary

This change should not change anything in the behavior of trap_pfault(), while eliminating obfuscation of jumping to the code which checks for reversed condition.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kib created this revision.Mon, Jan 1, 7:54 PM
kib added a reviewer: alc.Mon, Jan 1, 7:55 PM
kib updated this revision to Diff 37367.Mon, Jan 1, 8:00 PM

Fix amd64 portion of the patch.

alc added inline comments.Mon, Jan 1, 8:17 PM
sys/amd64/amd64/trap.c
663 ↗(On Diff #37366)

The unconditional initialization of the variable "rv" to zero is now redundant. Arguably, zero was never a value of the correct type for its initialization, because it's not a KERN_*.

kib updated this revision to Diff 37368.Mon, Jan 1, 8:21 PM

Remove initialization of rv.

alc accepted this revision.Mon, Jan 1, 8:25 PM
This revision is now accepted and ready to land.Mon, Jan 1, 8:25 PM
This revision was automatically updated to reflect the committed changes.