aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
diff options
context:
space:
mode:
authorDamien Le Moal <[email protected]>2024-10-12 20:32:41 +0900
committerManivannan Sadhasivam <[email protected]>2024-10-12 17:25:54 +0530
commitca3c342fb3c76eee739a1cfc4ff59841722ebee7 (patch)
treef45a27c13c7e359a50e0bda319294535fc31e4bf /tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
parent9852d85ec9d492ebef56dc5f229416c925758edc (diff)
PCI: endpoint: Introduce pci_epc_function_is_valid()
Introduce the epc core helper function pci_epc_function_is_valid() to verify that an epc pointer, a physical function number and a virtual function number are all valid. This avoids repeating the code pattern: if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions) return err; if (vfunc_no > 0 && (!epc->max_vfs || vfunc_no > epc->max_vfs[func_no])) return err; in many functions of the endpoint controller core code. Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Niklas Cassel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Manivannan Sadhasivam <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py')
0 files changed, 0 insertions, 0 deletions