• Nathan Lynch's avatar
    powerpc/rtas_pci: rename and properly expose config access APIs · 9be4feb7
    Nathan Lynch authored
    The rtas_read_config() and rtas_write_config() functions in
    kernel/rtas_pci.c have external linkage and two users in arch/powerpc:
    the rtas_pci code itself and the pseries platform's "enhanced error
    handling" (EEH) support code.
    
    The prototypes for these functions in asm/ppc-pci.h have until now
    been guarded by CONFIG_EEH since the only external caller is the
    pseries EEH code. However, this presumably has always generated
    warnings when built with !CONFIG_EEH and -Wmissing-prototypes:
    
      arch/powerpc/kernel/rtas_pci.c:46:5: error: no previous prototype for
      function 'rtas_read_config' [-Werror,-Wmissing-prototypes]
         46 | int rtas_read_config(struct pci_dn *pdn, int where,
                                   int size, u32 *val)
    
      arch/powerpc/kernel/rtas_pci.c:98:5: error: no previous prototype for
      function 'rtas_write_config' [-Werror,-Wmissing-prototypes]
         98 | int rtas_write_config(struct pci_dn *pdn, int where,
                                    int size, u32 val)
    
    The introduction of commit c6345dfa6e3e ("Makefile.extrawarn: turn on
    missing-prototypes globally") forces the issue.
    
    The efika and chrp platform code have (static) functions with the same
    names but different signatures. We may as well eliminate the potential
    for conflicts and confusion by renaming the globally visible versions
    as their prototypes get moved out of the CONFIG_EEH-guarded region;
    their current names are too generic anyway. Since they operate on
    objects of the type 'struct pci_dn *', give them the slightly more
    verbose prefix "rtas_pci_dn_" and fix up all the call sites.
    
    Fixes: c6345dfa6e3e ("Makefile.extrawarn: turn on missing-prototypes globally")
    Reported-by: default avatarLinux Kernel Functional Testing <lkft@linaro.org>
    Closes: https://lore.kernel.org/linuxppc-dev/CA+G9fYt0LLXtjSz+Hkf3Fhm-kf0ZQanrhUS+zVZGa3O+Wt2+vg@mail.gmail.com/Signed-off-by: default avatarNathan Lynch <nathanl@linux.ibm.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://msgid.link/20231127-rtas-pci-rw-config-v1-1-385d29ace3df@linux.ibm.com
    9be4feb7
eeh_pseries.c 23.7 KB