diff options
author | Nicolin Chen <[email protected]> | 2022-07-22 19:02:47 -0700 |
---|---|---|
committer | Alex Williamson <[email protected]> | 2022-07-23 07:29:10 -0600 |
commit | e8f90717ed3b58e81c480b3aa38e641c0da5a456 (patch) | |
tree | 69f1de7bd29fe45b62bfcc86977bc767dfa9a7b5 /scripts/gdb/linux/utils.py | |
parent | 9cb633acfe65101854fce456ccba4108db3ccbdb (diff) |
vfio: Make vfio_unpin_pages() return void
There's only one caller that checks its return value with a WARN_ON_ONCE,
while all other callers don't check the return value at all. Above that,
an undo function should not fail. So, simplify the API to return void by
embedding similar WARN_ONs.
Also for users to pinpoint which condition fails, separate WARN_ON lines,
yet remove the "driver->ops->unpin_pages" check, since it's unreasonable
for callers to unpin on something totally random that wasn't even pinned.
And remove NULL pointer checks for they would trigger oops vs. warnings.
Note that npage is already validated in the vfio core, thus drop the same
check in the type1 code.
Suggested-by: Christoph Hellwig <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Kirti Wankhede <[email protected]>
Tested-by: Terrence Xu <[email protected]>
Signed-off-by: Nicolin Chen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions