[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVU1qurBki6uf3UadK0Dted67pnhE7+2CDGYmK7QCNY0g@mail.gmail.com>
Date: Wed, 31 May 2023 09:04:47 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Sui Jingfeng <suijingfeng@...ngson.cn>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, loongson-kernel@...ts.loongnix.cn,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] linux/pci.h: add a dummy implement for pci_clear_master()
Hi Sui,
On Tue, May 30, 2023 at 12:21 PM Sui Jingfeng <suijingfeng@...ngson.cn> wrote:
> As some arch(m68k for example) doesn't have config_pci enabled, drivers[1]
> call pci_clear_master() without config_pci guard can not built.
>
> drivers/gpu/drm/etnaviv/etnaviv_pci_drv.c:
> In function 'etnaviv_gpu_pci_fini':
> >> drivers/gpu/drm/etnaviv/etnaviv_pci_drv.c:32:9:
> error: implicit declaration of function 'pci_clear_master';
> did you mean 'pci_set_master'? [-Werror=implicit-function-declaration]
> 32 | pci_clear_master(pdev);
> | ^~~~~~~~~~~~~~~~
> | pci_set_master
> cc1: some warnings being treated as errors
>
> [1] https://patchwork.freedesktop.org/patch/539977/?series=118522&rev=1
>
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202305301659.4guSLavL-lkp@intel.com/
> Signed-off-by: Sui Jingfeng <suijingfeng@...ngson.cn>
Thanks for your patch!
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1904,6 +1904,7 @@ static inline int pci_dev_present(const struct pci_device_id *ids)
> #define pci_dev_put(dev) do { } while (0)
>
> static inline void pci_set_master(struct pci_dev *dev) { }
> +static inline void pci_clear_master(struct pci_dev *dev) { }
> static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
> static inline void pci_disable_device(struct pci_dev *dev) { }
> static inline int pcim_enable_device(struct pci_dev *pdev) { return -EIO; }
Makes perfect sense, given there has been a dummy for pci_set_master()
since the git stone age. Apparently adding the dummy was forgotten
when pci_clear_master() was introduced.
Fixes: 6a479079c07211bf ("PCI: Add pci_clear_master() as opposite of
pci_set_master()")
Reviewed-by: Geert Uytterhoeven <geert@...ux-m68k.org>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists