]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Refactor PCIOCGETCONF for improved readability.
authorbrooks <brooks@FreeBSD.org>
Mon, 9 Apr 2018 22:59:10 +0000 (22:59 +0000)
committerbrooks <brooks@FreeBSD.org>
Mon, 9 Apr 2018 22:59:10 +0000 (22:59 +0000)
commit9ceceb90cf14bfb2d01fbdc3bdb1a7108b210968
treeadf98a682eb150ad49f92f02eea808e614a0f4a2
parent88d57fa15c045dbd755af45b94013455eb40f7cc
Refactor PCIOCGETCONF for improved readability.

The code now has a single, consistant flow for all three ioctl
variants. ifdefs and for pre-FreeBSD-7 compatability are moved to
functions and macros. So the flow is alwasy the same, we impose
the cost of allocating, copying to, updating from, and freeing a
copy of struct pci_conf_io on all paths.

This change will allow PCIOCGETCONF32 support currently in
sys/compat/freebsd32/freebsd32_ioctl.c to be moved here.

Reviewed by: kib, jhb
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14978
sys/dev/pci/pci_user.c