summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/pseries/pci.c
diff options
context:
space:
mode:
authorNathan Lynch <nathanl@linux.ibm.com>2023-02-10 12:42:07 -0600
committerMichael Ellerman <mpe@ellerman.id.au>2023-02-13 22:35:03 +1100
commit716bfc97bd5fb7b442cdd06081f49df097f2e27b (patch)
treec231fb6c57715de2748d3bbe44e60f8f7fca4e73 /arch/powerpc/platforms/pseries/pci.c
parente58d9e17b11b776e32b1d3d80bdc63d39de3463d (diff)
powerpc/rtas: introduce rtas_function_token() API
Users of rtas_token() supply a string argument that can't be validated at build time. A typo or misspelling has to be caught by inspection or by observing wrong behavior at runtime. Since the core RTAS code now has consolidated the names of all possible RTAS functions and mapped them to their tokens, token lookup can be implemented using symbolic constants to index a static array. So introduce rtas_function_token(), a replacement API which does that, along with a rtas_service_present()-equivalent helper, rtas_function_implemented(). Callers supply an opaque predefined function handle which is used internally to index the function table. Typos or other inappropriate arguments yield build errors, and the function handle is a type that can't be easily confused with RTAS tokens or other integer types. Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20230125-b4-powerpc-rtas-queue-v3-19-26929c8cce78@linux.ibm.com
Diffstat (limited to 'arch/powerpc/platforms/pseries/pci.c')
0 files changed, 0 insertions, 0 deletions