HomeFreeBSD

hwpmc: split out PMC_OP_PMCALLOCATE

Description

hwpmc: split out PMC_OP_PMCALLOCATE

Split out the large chunk of functional logic from the syscall handler
into a helper function. This keeps it separate from the syscall
control-flow logic, resulting in better readability overall. It also
wins back a level of indentation.

Flip the return values of the pmc_can_allocate_row() and
pmc_can_allocate_rowindex() functions to boolean types, like their
naming implies. We weren't actually using the error codes they were
returning.

While here, make some small style cleanups. No functional change
intended.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40292

Details

Provenance
mhorneAuthored on Jun 14 2023, 4:33 PM
Reviewer
jkoshy
Differential Revision
D40292: hwpmc: split out PMC_OP_PMCALLOCATE
Parents
rGa133f64239cd: hwpmc: split out PMC_OP_PMCATTACH/PMC_OP_PMCDETACH
Branches
Unknown
Tags
Unknown