Page MenuHomeFreeBSD

Replace boolean_t with bool
AbandonedPublic

Authored by minsoochoo0122_proton.me on Jan 30 2024, 5:02 AM.
Referenced Files
Unknown Object (File)
Oct 9 2024, 10:25 PM
Unknown Object (File)
Oct 4 2024, 4:23 PM
Unknown Object (File)
Sep 30 2024, 5:06 PM
Unknown Object (File)
Sep 17 2024, 2:54 PM
Unknown Object (File)
Sep 17 2024, 8:28 AM
Unknown Object (File)
Sep 15 2024, 1:41 AM
Unknown Object (File)
Sep 8 2024, 3:34 PM
Unknown Object (File)
Sep 8 2024, 2:41 PM

Details

Reviewers
andrew
slm
manu
jrtc27
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Contributor Reviews (src)
Summary

This might not be a right way to fix types since style(9) does not accept syntax changes.

bool (or _Bool) is C standard whereas boolean_t is not. This can cause problems in both userland and kernel.

An exemple of this is ioat.c, where intrdelay_supported and is_submitter_processing are supposed to be 0/1 bool values, but they are actually int behind the hood.
This means values other than 0/1 can be accepted, which is not a intended behaviour of bool type.

cddl/, contrib/, sys/contrib/, and crypto/ are excluded.

ZFS related code is also excluded such as bectl(8) since boolean_t is still used in OpenZFS.

Test Plan

make buildworld && make buildkernel

I tested by building UFS raw vm image and running it on bhyve.

regression tests might be needed.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 55705
Build 52594: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Jan 30 2024, 5:02 AM
jrtc27 requested changes to this revision.Jan 30 2024, 5:22 AM
jrtc27 added a subscriber: jrtc27.

This kind of diff is way too big to review, it needs to be broken up. It's easy to mass rename like this but a lot harder to verify that you've actually done the right thing. The second file I picked to look at the diff at was clearly not correct (see the comment linked to this), so that doesn't bode well for the rest of the diff. Also some of the NIC drivers in the tree are really vendor imports, so any changes like this that get made to them should make their way upstream, otherwise there is a risk they got lost. I have not checked if that applies here or not.

sys/dev/cxgbe/osdep.h
79

Clearly not what you want here

This revision now requires changes to proceed.Jan 30 2024, 5:22 AM