Page MenuHomeFreeBSD

linuxkpi: Correct kstrtobool
ClosedPublic

Authored by des on Jan 2 2026, 8:54 AM.
Tags
None
Referenced Files
F152677033: D54451.id168871.diff
Thu, Apr 16, 11:22 AM
Unknown Object (File)
Sat, Apr 11, 10:12 PM
Unknown Object (File)
Tue, Apr 7, 9:25 AM
Unknown Object (File)
Sat, Apr 4, 2:25 PM
Unknown Object (File)
Sat, Apr 4, 2:02 AM
Unknown Object (File)
Mar 2 2026, 10:23 PM
Unknown Object (File)
Feb 10 2026, 11:13 PM
Unknown Object (File)
Feb 10 2026, 4:54 PM
Subscribers

Details

Summary

Implement the exact same logic as in Linux:

  • Accept 'e', 't', 'y', '1', "on" for true.
  • Accept 'd', 'f', 'n', '0', "of" for false.
  • Disregard any characters beyond that.
  • Check that the string is not null, but don't check the result pointer.

MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69568
Build 66451: arc lint + arc unit