[PATCH 00/11] Drive-by PCI W=1 cleanups

These are some trivial cleanup patches I made after compiling U-Boot for ls1028ardb_tfa_defconfig with W=1.
Vladimir Oltean (11): pci: provide prototype for pci_skip_dev outside of #if defined(CONFIG_DM_PCI_COMPAT) pci: include pci_internal.h inside pci_auto.c pci: pci_bar_show can be static pci: pci_header_show can be static pci: pciinfo_header can be static pci: pci_write_config can be static pci: pci_read_config can be static pci: _dm_pci_phys_to_bus can be static pci: layerscape: ls_pcie_conf_address can be static pci: pcie_layerscape_fixup_common: include fdt_support.h for ft_pci_setup pci: pcie_layerscape_fixup_common: lx2_board_fix_fdt can be static
cmd/pci.c | 6 +++--- drivers/pci/pci-uclass.c | 14 +++++++------- drivers/pci/pci_auto.c | 1 + drivers/pci/pcie_layerscape_fixup_common.c | 3 ++- drivers/pci/pcie_layerscape_rc.c | 4 ++-- include/pci.h | 2 +- 6 files changed, 16 insertions(+), 14 deletions(-)

The weak definition of pci_skip_dev from drivers/pci/pci_common.c is not under CONFIG_DM_PCI_COMPAT, and that definition needs a previous function prototype declaration to avoid W=1 build warnings.
That prototype is not available due to it being under CONFIG_DM_PCI_COMPAT, so move it outside of that preprocessor block.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- include/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/pci.h b/include/pci.h index 0fc22adffd00..11009a2f787a 100644 --- a/include/pci.h +++ b/include/pci.h @@ -724,6 +724,7 @@ void pciauto_config_init(struct pci_controller *hose); */ int pciauto_region_allocate(struct pci_region *res, pci_size_t size, pci_addr_t *bar, bool supports_64bit); +int pci_skip_dev(struct pci_controller *hose, pci_dev_t dev);
#if defined(CONFIG_DM_PCI_COMPAT) extern int pci_hose_read_config_byte_via_dword(struct pci_controller *hose, @@ -741,7 +742,6 @@ extern struct pci_controller* pci_bus_to_hose(int bus); extern struct pci_controller *find_hose_by_cfg_addr(void *cfg_addr); extern struct pci_controller *pci_get_hose_head(void);
-extern int pci_skip_dev(struct pci_controller *hose, pci_dev_t dev); extern int pci_hose_scan(struct pci_controller *hose); extern int pci_hose_scan_bus(struct pci_controller *hose, int bus);

On Fri, Sep 17, 2021 at 8:11 PM Vladimir Oltean vladimir.oltean@nxp.com wrote:
The weak definition of pci_skip_dev from drivers/pci/pci_common.c is not under CONFIG_DM_PCI_COMPAT, and that definition needs a previous function prototype declaration to avoid W=1 build warnings.
That prototype is not available due to it being under CONFIG_DM_PCI_COMPAT, so move it outside of that preprocessor block.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com
include/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Fri, Sep 17, 2021 at 03:11:20PM +0300, Vladimir Oltean wrote:
The weak definition of pci_skip_dev from drivers/pci/pci_common.c is not under CONFIG_DM_PCI_COMPAT, and that definition needs a previous function prototype declaration to avoid W=1 build warnings.
That prototype is not available due to it being under CONFIG_DM_PCI_COMPAT, so move it outside of that preprocessor block.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot/next, thanks!

To avoid a build warning with W=1, provide a function prototype for dm_pciauto_prescan_setup_bridge, which is a non-static function whose definition is inside pci_auto.c.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- drivers/pci/pci_auto.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c index b128a05dd380..8de5e7e12d43 100644 --- a/drivers/pci/pci_auto.c +++ b/drivers/pci/pci_auto.c @@ -12,6 +12,7 @@ #include <errno.h> #include <log.h> #include <pci.h> +#include "pci_internal.h"
/* the user can define CONFIG_SYS_PCI_CACHE_LINE_SIZE to avoid problems */ #ifndef CONFIG_SYS_PCI_CACHE_LINE_SIZE

On Fri, Sep 17, 2021 at 8:11 PM Vladimir Oltean vladimir.oltean@nxp.com wrote:
To avoid a build warning with W=1, provide a function prototype for dm_pciauto_prescan_setup_bridge, which is a non-static function whose definition is inside pci_auto.c.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com
drivers/pci/pci_auto.c | 1 + 1 file changed, 1 insertion(+)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Fri, Sep 17, 2021 at 03:11:21PM +0300, Vladimir Oltean wrote:
To avoid a build warning with W=1, provide a function prototype for dm_pciauto_prescan_setup_bridge, which is a non-static function whose definition is inside pci_auto.c.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot/next, thanks!

To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- cmd/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/pci.c b/cmd/pci.c index af75a6cfff4a..ebe7c0fc5377 100644 --- a/cmd/pci.c +++ b/cmd/pci.c @@ -59,7 +59,7 @@ static void pci_show_regs(struct udevice *dev, struct pci_reg_info *regs) } }
-int pci_bar_show(struct udevice *dev) +static int pci_bar_show(struct udevice *dev) { u8 header_type; int bar_cnt, bar_id, mem_type;

On Fri, Sep 17, 2021 at 8:11 PM Vladimir Oltean vladimir.oltean@nxp.com wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com
cmd/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Fri, Sep 17, 2021 at 03:11:22PM +0300, Vladimir Oltean wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot/next, thanks!

To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- cmd/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/pci.c b/cmd/pci.c index ebe7c0fc5377..7febff497c54 100644 --- a/cmd/pci.c +++ b/cmd/pci.c @@ -223,7 +223,7 @@ static struct pci_reg_info regs_cardbus[] = { * * @dev: Bus+Device+Function number */ -void pci_header_show(struct udevice *dev) +static void pci_header_show(struct udevice *dev) { unsigned long class, header_type;

On Fri, Sep 17, 2021 at 8:11 PM Vladimir Oltean vladimir.oltean@nxp.com wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com
cmd/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Fri, Sep 17, 2021 at 03:11:23PM +0300, Vladimir Oltean wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot/next, thanks!

To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- cmd/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/pci.c b/cmd/pci.c index 7febff497c54..cfabdc0f3012 100644 --- a/cmd/pci.c +++ b/cmd/pci.c @@ -251,7 +251,7 @@ static void pci_header_show(struct udevice *dev) } }
-void pciinfo_header(int busnum, bool short_listing) +static void pciinfo_header(int busnum, bool short_listing) { printf("Scanning PCI devices on bus %d\n", busnum);

On Fri, Sep 17, 2021 at 8:11 PM Vladimir Oltean vladimir.oltean@nxp.com wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com
cmd/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Fri, Sep 17, 2021 at 03:11:24PM +0300, Vladimir Oltean wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot/next, thanks!

To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- drivers/pci/pci-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index ce2eb5da2ca5..20bddb597588 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -304,8 +304,8 @@ int pci_bus_clrset_config32(struct udevice *bus, pci_dev_t bdf, int offset, return pci_bus_write_config(bus, bdf, offset, val, PCI_SIZE_32); }
-int pci_write_config(pci_dev_t bdf, int offset, unsigned long value, - enum pci_size_t size) +static int pci_write_config(pci_dev_t bdf, int offset, unsigned long value, + enum pci_size_t size) { struct udevice *bus; int ret;

On Fri, Sep 17, 2021 at 8:11 PM Vladimir Oltean vladimir.oltean@nxp.com wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com
drivers/pci/pci-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Fri, Sep 17, 2021 at 03:11:25PM +0300, Vladimir Oltean wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot/next, thanks!

To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- drivers/pci/pci-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index 20bddb597588..f0313d059042 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -369,8 +369,8 @@ int pci_bus_read_config(const struct udevice *bus, pci_dev_t bdf, int offset, return ops->read_config(bus, bdf, offset, valuep, size); }
-int pci_read_config(pci_dev_t bdf, int offset, unsigned long *valuep, - enum pci_size_t size) +static int pci_read_config(pci_dev_t bdf, int offset, unsigned long *valuep, + enum pci_size_t size) { struct udevice *bus; int ret;

On Fri, Sep 17, 2021 at 8:11 PM Vladimir Oltean vladimir.oltean@nxp.com wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com
drivers/pci/pci-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Fri, Sep 17, 2021 at 03:11:26PM +0300, Vladimir Oltean wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot/next, thanks!

To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- drivers/pci/pci-uclass.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index f0313d059042..f3ac6fdb0031 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -1433,9 +1433,9 @@ phys_addr_t dm_pci_bus_to_phys(struct udevice *dev, pci_addr_t bus_addr, return phys_addr; }
-int _dm_pci_phys_to_bus(struct udevice *dev, phys_addr_t phys_addr, - unsigned long flags, unsigned long skip_mask, - pci_addr_t *ba) +static int _dm_pci_phys_to_bus(struct udevice *dev, phys_addr_t phys_addr, + unsigned long flags, unsigned long skip_mask, + pci_addr_t *ba) { struct pci_region *res; struct udevice *ctlr;

On Fri, Sep 17, 2021 at 8:11 PM Vladimir Oltean vladimir.oltean@nxp.com wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com
drivers/pci/pci-uclass.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Fri, Sep 17, 2021 at 03:11:27PM +0300, Vladimir Oltean wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot/next, thanks!

To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- drivers/pci/pcie_layerscape_rc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pcie_layerscape_rc.c b/drivers/pci/pcie_layerscape_rc.c index bd2c19f7f0c9..f50d6ef65396 100644 --- a/drivers/pci/pcie_layerscape_rc.c +++ b/drivers/pci/pcie_layerscape_rc.c @@ -143,8 +143,8 @@ static int ls_pcie_addr_valid(struct ls_pcie_rc *pcie_rc, pci_dev_t bdf) return 0; }
-int ls_pcie_conf_address(const struct udevice *bus, pci_dev_t bdf, - uint offset, void **paddress) +static int ls_pcie_conf_address(const struct udevice *bus, pci_dev_t bdf, + uint offset, void **paddress) { struct ls_pcie_rc *pcie_rc = dev_get_priv(bus); struct ls_pcie *pcie = pcie_rc->pcie;

On Fri, Sep 17, 2021 at 8:11 PM Vladimir Oltean vladimir.oltean@nxp.com wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com
drivers/pci/pcie_layerscape_rc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Fri, Sep 17, 2021 at 03:11:28PM +0300, Vladimir Oltean wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot/next, thanks!

The function prototype for ft_pci_setup is inside fdt_support.h, we need to include that header.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- drivers/pci/pcie_layerscape_fixup_common.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/pci/pcie_layerscape_fixup_common.c b/drivers/pci/pcie_layerscape_fixup_common.c index 8b924d404c2d..08dac7632b0f 100644 --- a/drivers/pci/pcie_layerscape_fixup_common.c +++ b/drivers/pci/pcie_layerscape_fixup_common.c @@ -12,6 +12,7 @@ #include <asm/arch/clock.h> #include <asm/arch/soc.h> #include <linux/libfdt.h> +#include <fdt_support.h> #include "pcie_layerscape_fixup_common.h"
void ft_pci_setup(void *blob, struct bd_info *bd)

On Fri, Sep 17, 2021 at 8:11 PM Vladimir Oltean vladimir.oltean@nxp.com wrote:
The function prototype for ft_pci_setup is inside fdt_support.h, we need to include that header.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com
drivers/pci/pcie_layerscape_fixup_common.c | 1 + 1 file changed, 1 insertion(+)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Fri, Sep 17, 2021 at 03:11:29PM +0300, Vladimir Oltean wrote:
The function prototype for ft_pci_setup is inside fdt_support.h, we need to include that header.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot/next, thanks!

To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- drivers/pci/pcie_layerscape_fixup_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/pcie_layerscape_fixup_common.c b/drivers/pci/pcie_layerscape_fixup_common.c index 08dac7632b0f..3216a20027a8 100644 --- a/drivers/pci/pcie_layerscape_fixup_common.c +++ b/drivers/pci/pcie_layerscape_fixup_common.c @@ -30,7 +30,7 @@ void ft_pci_setup(void *blob, struct bd_info *bd) }
#if defined(CONFIG_FSL_LAYERSCAPE) -int lx2_board_fix_fdt(void *fdt) +static int lx2_board_fix_fdt(void *fdt) { char *reg_name, *old_str, *new_str; const char *reg_names;

On Fri, Sep 17, 2021 at 8:11 PM Vladimir Oltean vladimir.oltean@nxp.com wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com
drivers/pci/pcie_layerscape_fixup_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Fri, Sep 17, 2021 at 03:11:30PM +0300, Vladimir Oltean wrote:
To avoid W=1 build warnings, declare this function as static, since it is not used outside of this translation module.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot/next, thanks!
participants (3)
-
Bin Meng
-
Tom Rini
-
Vladimir Oltean