It seems unlikely, but we might as well defend against garbage in the
lower bytes -- better to return false more directly than to act on
elements outside of the brand array.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 61532 Build 58416: arc lint + arc unit
Event Timeline
Yeah, I was trying to explain this with the comment. and don't seem to have quite worded it well enough.. we expect four digits + (M, G, or T) before we see 'Hz', so logically it makes sense to start the search there since we won't be able to parse a valid frequency in-bounds before that.
In the document referenced earlier: http://www.intel.com/assets/pdf/appnote/241618.pdf -- figure 3-10
Drop the garbage reference entirely, expand on the description to note the
figure used. Also note some possible future work to rewrite the later part of
this to more closely follow the algorithm described, as they don't seem to want
to commit to D.DD[MGT]Hz or DDDD[MGT]Hz -- they specifically recommend scanning
for a prior space. This would also offer us an opportunity to validate that
all of the involved digits are actually [0-9] or '.'.
Note that appnote is deprecated. Intel incorporated its content into SDM and always references CPUID description in SDM now.
Also when doing 'hard' references like page numbers/picture numbers, please specify the document revision.