treewide: Clean up usage of DECLARE_GLOBAL_DATA_PTR
Get series with b4
b4 am [email protected] change-id 20260202-cleanup-560c900f7bc3Versions newest first
- v2 Latest14 patches 1 replyIn review
- v114 patches 10 repliesSuperseded
Changes in v2 from the cover letter
- Rebased to origin/master to resolve conflicts.
- Added tags for patch 14
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | beacon: imx8mm/n: Drop useless filesboard/ board/ board/ +1 more | +0 | 0 replies | |
| 2/14 | mediatek: mt7622: Drop useless board filesboard/ board/ | +1 | 0 replies | |
| 3/14 | common: cli_hush: Include vsprintf.hcommon/ | +1 | 0 replies | |
| 4/14 | cmd: mem: Include vsprintf.hcmd/ | +1 | 0 replies | |
| 5/14 | test: log_filter: Include vsprintf.htest/ | +1 | 0 replies | |
| 6/14 | xtensa: relocate: Add missing headersarch/ | +2 | 0 replies | |
| 7/14 | toradex: common: Add missing headersboard/ board/ | +4 | 0 replies | |
| 8/14 | tegra: pmc: Cleanup headersarch/ | +1 | 0 replies | |
| 9/14 | rockchip: evk_rk3308: Cleanup headersboard/ | +2 | 0 replies | |
| 10/14 | nxp: emc2305: Cleanup headersboard/ | +1 | 0 replies | |
| 11/14 | pci: layerspace: Add missing header filesdrivers/ | +3 | 0 replies | |
| 12/14 | renesas: common: Include asm-generic/u-boot.hboard/ board/ board/ | +3 | 0 replies | |
| 13/14 | socfpga: clock_manager_s10: Add missing header filesarch/ | +2 | 0 replies | |
| 14/14 | treewide: Clean up DECLARE_GLOBAL_DATA_PTR usagearch/ arch/ arch/ +284 more | +0 | 0 replies |
Reviews trailers per patch
1 of 14 patches has a Reviewed-by or Acked-by.
| Patch | Patrice Chotard | Anshul Dalal | Yao Zi |
|---|---|---|---|
| 1/14 | |||
| 2/14 | |||
| 3/14 | |||
| 4/14 | |||
| 5/14 | |||
| 6/14 | |||
| 7/14 | |||
| 8/14 | |||
| 9/14 | |||
| 10/14 | |||
| 11/14 | |||
| 12/14 | |||
| 13/14 | |||
| 14/14 | R-b | T-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v2 00/14] treewide: Clean up usage of DECLARE_GLOBAL_DATA_PTR
This patch set primarily removes unused DECLARE_GLOBAL_DATA_PTR instances.
Many files declare DECLARE_GLOBAL_DATA_PTR and include asm/global_data.h even though gd is never used. In these cases, asm/global_data.h is effectively treated as a proxy header, which is not a good practice.
Following the Include What You Use principle, files should include only the headers they actually depend on, rather than relying on global_data.h indirectly. This approach is also adopted in Linux kernel [1].
The first few patches are prepartion to avoid building break after remove the including of global_data.h.
A script is for filtering the files:
list=find . -name "*.[ch]"
for source in ${list}
do
result=`sed -n '/DECLARE_GLOBAL_DATA_PTR/p' ${source}`
if [ "${result}" == "DECLARE_GLOBAL_DATA_PTR;" ]; then
echo "Found in ${source}"
result=`sed -n '/\<gd\>/p' ${source}`
result2=`sed -n '/\<gd_/p' ${source}`
result3=`sed -n '/\<gd->/p' ${source}`
if [ "${result}" == "" ] && [ "${result2}" == "" ] && [ "${result3}" == "" ];then
echo "Cleanup ${source}"
sed -i '/DECLARE_GLOBAL_DATA_PTR/{N;/\n[[:space:]]*$/d;s/.*\n//;}' ${source}
sed -i '/DECLARE_GLOBAL_DATA_PTR/d' ${source}
sed -i '/global_data.h/d' ${source}
git add ${source}
fi
fidone
CI: https://github.com/u-boot/u-boot/pull/865
---
Changes in v2:
- Rebased to origin/master to resolve conflicts.
- Added tags for patch 14
---
Peng Fan (14):
beacon: imx8mm/n: Drop useless files
mediatek: mt7622: Drop useless board files
common: cli_hush: Include vsprintf.h
cmd: mem: Include vsprintf.h
test: log_filter: Include vsprintf.h
xtensa: relocate: Add missing headers
toradex: common: Add missing headers
tegra: pmc: Cleanup headers
rockchip: evk_rk3308: Cleanup headers
nxp: emc2305: Cleanup headers
pci: layerspace: Add missing header files
renesas: common: Include asm-generic/u-boot.h
socfpga: clock_manager_s10: Add missing header files
treewide: Clean up DECLARE_GLOBAL_DATA_PTR usage
arch/arc/lib/bootm.c | 3 --- arch/arm/cpu/armv7/s5p4418/cpu.c | 3 --- arch/arm/mach-aspeed/ast2600/spl.c | 3 --- arch/arm/mach-imx/imx8/clock.c | 3 --- arch/arm/mach-imx/imx8/fdt.c | 3 --- arch/arm/mach-imx/imx8/iomux.c | 3 --- arch/arm/mach-imx/imx8m/clock_imx8mm.c | 3 --- arch/arm/mach-imx/imx8ulp/cgc.c | 3 --- arch/arm/mach-imx/imx8ulp/clock.c | 3 --- arch/arm/mach-imx/imx9/clock.c | 3 --- arch/arm/mach-imx/imx9/clock_root.c | 3 --- arch/arm/mach-imx/misc.c | 3 --- arch/arm/mach-imx/spl_imx_romapi.c | 3 --- arch/arm/mach-meson/board-axg.c | 3 --- arch/arm/mach-meson/board-g12a.c | 3 --- arch/arm/mach-meson/board-gx.c | 3 --- arch/arm/mach-socfpga/clock_manager_agilex.c | 3 --- arch/arm/mach-socfpga/clock_manager_agilex5.c | 3 --- arch/arm/mach-socfpga/clock_manager_n5x.c | 3 --- arch/arm/mach-socfpga/clock_manager_s10.c | 5 ++--- arch/arm/mach-socfpga/mailbox_s10.c | 3 --- arch/arm/mach-socfpga/misc_gen5.c | 3 --- arch/arm/mach-socfpga/misc_soc64.c | 3 --- arch/arm/mach-socfpga/mmu-arm64_s10.c | 3 --- arch/arm/mach-socfpga/reset_manager_s10.c | 3 --- arch/arm/mach-socfpga/spl_agilex.c | 3 --- arch/arm/mach-socfpga/spl_agilex5.c | 3 --- arch/arm/mach-socfpga/spl_agilex7m.c | 3 --- arch/arm/mach-socfpga/spl_gen5.c | 3 --- arch/arm/mach-socfpga/spl_n5x.c | 3 --- arch/arm/mach-socfpga/spl_s10.c | 3 --- arch/arm/mach-socfpga/system_manager_soc64.c | 3 --- arch/arm/mach-tegra/pmc.c | 4 +--- arch/microblaze/lib/bootm.c | 3 --- arch/mips/mach-ath79/qca956x/ddr.c | 3 --- arch/mips/mach-mscc/cpu.c | 3 --- arch/mips/mach-mtmips/ddr_cal.c | 3 --- arch/mips/mach-octeon/cvmx-pko.c | 2 -- arch/nios2/lib/bootm.c | 3 --- arch/riscv/cpu/andes/spl.c | 3 --- arch/riscv/cpu/cv1800b/dram.c | 3 --- arch/riscv/cpu/generic/dram.c | 3 --- arch/riscv/cpu/k230/dram.c | 3 --- arch/riscv/cpu/th1520/spl.c | 2 -- arch/sh/lib/bootm.c | 3 --- arch/x86/cpu/ivybridge/model_206ax.c | 3 --- arch/x86/lib/init_helpers.c | 3 --- arch/x86/lib/zimage.c | 3 --- arch/xtensa/lib/relocate.c | 2 ++ arch/xtensa/lib/time.c | 3 --- board/BuR/brsmarc1/board.c | 3 --- board/BuR/common/common.c | 3 --- board/Marvell/octeontx/smc.c | 3 --- board/Marvell/octeontx2/smc.c | 3 --- board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c | 2 -- board/advantech/imx8mp_rsb3720a1/spl.c | 2 -- board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c | 2 -- board/advantech/imx8qm_rom7720_a1/imx8qm_rom7720_a1.c | 3 --- board/andestech/voyager/voyager.c | 3 --- board/armltd/vexpress64/vexpress64.c | 3 --- board/beacon/imx8mm/Makefile | 1 - board/beacon/imx8mm/imx8mm_beacon.c | 8 -------- board/beacon/imx8mm/spl.c | 3 --- board/beacon/imx8mn/Makefile | 1 - board/beacon/imx8mn/imx8mn_beacon.c | 8 -------- board/beacon/imx8mn/spl.c | 3 --- board/beacon/imx8mp/spl.c | 3 --- board/beagle/beagleboneai64/beagleboneai64.c | 2 -- board/beagle/beagleplay/beagleplay.c | 2 -- board/broadcom/bcmns/ns.c | 3 --- board/cloos/imx8mm_phg/imx8mm_phg.c | 3 --- board/cloos/imx8mm_phg/spl.c | 3 --- board/compulab/imx8mm-cl-iot-gate/spl.c | 2 -- board/coreboot/coreboot/coreboot.c | 3 --- board/cssi/cmpc885/cmpc885.c | 2 -- board/data_modul/imx8mm_edm_sbc/imx8mm_data_modul_edm_sbc.c | 2 -- board/data_modul/imx8mm_edm_sbc/spl.c | 2 -- board/data_modul/imx8mp_edm_sbc/imx8mp_data_modul_edm_sbc.c | 2 -- board/data_modul/imx8mp_edm_sbc/spl.c | 2 -- board/dhelectronics/dh_imx8mp/common.c | 2 -- board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c | 2 -- board/dhelectronics/dh_imx8mp/spl.c | 2 -- board/emcraft/imx8mp_navqp/spl.c | 3 --- board/emulation/qemu-riscv/qemu-riscv.c | 2 -- board/engicam/imx8mm/icore_mx8mm.c | 2 -- board/engicam/imx8mm/spl.c | 2 -- board/engicam/imx8mp/icore_mx8mp.c | 3 --- board/engicam/imx8mp/spl.c | 3 --- board/gdsys/mpc8308/gazerbeam.c | 3 --- board/google/imx8mq_phanbell/imx8mq_phanbell.c | 3 --- board/highbank/highbank.c | 3 --- board/kontron/osm-s-mx8mp/osm-s-mx8mp.c | 3 --- board/kontron/osm-s-mx93/osm-s-mx93.c | 3 --- board/kontron/pitx_imx8m/pitx_imx8m.c | 2 -- board/mediatek/mt7622/Makefile | 2 +- board/mediatek/mt7622/mt7622_rfb.c | 12 ------------ board/mntre/imx8mq_reform2/imx8mq_reform2.c | 3 --- board/msc/sm2s_imx8mp/sm2s_imx8mp.c | 2 -- board/msc/sm2s_imx8mp/spl.c | 3 --- board/nxp/common/emc2305.c | 4 +--- board/nxp/imx8mm_evk/spl.c | 3 --- board/nxp/imx8qm_mek/imx8qm_mek.c | 3 --- board/nxp/imx8qxp_mek/imx8qxp_mek.c | 3 --- board/phytec/imx8mp-libra-fpsc/spl.c | 3 --- board/phytec/phycore_imx8mm/phycore-imx8mm.c | 3 --- board/phytec/phycore_imx8mm/spl.c | 3 --- board/phytec/phycore_imx8mp/phycore-imx8mp.c | 3 --- board/phytec/phycore_imx8mp/spl.c | 3 --- board/phytec/phycore_imx93/phycore-imx93.c | 3 --- board/polyhex/imx8mp_debix_model_a/imx8mp_debix_model_a.c | 3 --- board/polyhex/imx8mp_debix_model_a/spl.c | 3 --- board/purism/librem5/librem5.c | 2 -- board/purism/librem5/spl.c | 2 -- board/qualcomm/dragonboard410c/dragonboard410c.c | 3 --- board/qualcomm/dragonboard820c/dragonboard820c.c | 3 --- board/renesas/common/gen3-common.c | 4 +--- board/renesas/common/gen4-common.c | 4 +--- board/renesas/common/gen5-common.c | 4 +--- board/rockchip/evb_rk3308/evb_rk3308.c | 5 ++--- board/ronetix/imx8mq-cm/imx8mq_cm.c | 2 -- board/samsung/common/exynos5-dt.c | 3 --- board/samsung/common/misc.c | 3 --- board/st/stm32f429-discovery/stm32f429-discovery.c | 3 --- board/st/stm32f429-evaluation/stm32f429-evaluation.c | 3 --- board/st/stm32f469-discovery/stm32f469-discovery.c | 3 --- board/st/stm32f746-disco/stm32f746-disco.c | 3 --- board/st/stm32h743-disco/stm32h743-disco.c | 3 --- board/st/stm32h743-eval/stm32h743-eval.c | 3 --- board/st/stm32h747-disco/stm32h747-disco.c | 3 --- board/st/stm32h750-art-pi/stm32h750-art-pi.c | 3 --- board/technexion/pico-imx8mq/pico-imx8mq.c | 3 --- board/ti/am62x/evm.c | 2 -- board/ti/am64x/evm.c | 2 -- board/ti/j784s4/evm.c | 2 -- board/toradex/apalis-imx8/apalis-imx8.c | 3 --- board/toradex/apalis_t30/apalis_t30.c | 3 --- board/toradex/colibri-imx8x/colibri-imx8x.c | 3 --- board/toradex/colibri_t20/colibri_t20.c | 3 --- board/toradex/common/tdx-cfg-block.c | 3 --- board/toradex/common/tdx-cfg-block.h | 2 ++ board/toradex/common/tdx-common.h | 2 ++ board/toradex/smarc-imx8mp/smarc-imx8mp.c | 3 --- board/toradex/smarc-imx8mp/spl.c | 3 --- board/toradex/verdin-imx8mm/spl.c | 3 --- board/toradex/verdin-imx8mm/verdin-imx8mm.c | 3 --- board/toradex/verdin-imx8mp/spl.c | 3 --- board/toradex/verdin-imx8mp/verdin-imx8mp.c | 3 --- board/xilinx/zynq/bootimg.c | 3 --- boot/bootmeth-uclass.c | 2 -- boot/fdt_simplefb.c | 3 --- boot/image-sig.c | 2 -- boot/image.c | 3 --- cmd/bloblist.c | 3 --- cmd/bootefi.c | 3 --- cmd/bootm.c | 3 --- cmd/date.c | 3 --- cmd/mem.c | 4 +--- cmd/sound.c | 3 --- cmd/spl.c | 3 --- common/cli_hush.c | 4 +--- common/stdio.c | 3 --- drivers/block/sandbox.c | 3 --- drivers/bootcount/pmic_pfuze100.c | 2 -- drivers/cache/sandbox_cache.c | 3 --- drivers/clk/altera/clk-agilex.c | 3 --- drivers/clk/altera/clk-agilex5.c | 3 --- drivers/clk/altera/clk-mem-n5x.c | 3 --- drivers/clk/altera/clk-n5x.c | 3 --- drivers/clk/rockchip/clk_px30.c | 3 --- drivers/clk/rockchip/clk_rk3308.c | 3 --- drivers/clk/rockchip/clk_rk3528.c | 2 -- drivers/clk/rockchip/clk_rk3568.c | 2 -- drivers/clk/rockchip/clk_rk3576.c | 2 -- drivers/clk/rockchip/clk_rk3588.c | 2 -- drivers/clk/rockchip/clk_rv1108.c | 3 --- drivers/clk/rockchip/clk_rv1126.c | 2 -- drivers/cpu/bcm283x_cpu.c | 3 --- drivers/cpu/cpu-uclass.c | 2 -- drivers/cpu/imx8_cpu.c | 3 --- drivers/cpu/mtk_cpu.c | 3 --- drivers/firmware/arm-ffa/arm-ffa-uclass.c | 3 --- drivers/firmware/arm-ffa/arm-ffa.c | 3 --- drivers/firmware/arm-ffa/ffa-emul-uclass.c | 3 --- drivers/firmware/arm-ffa/sandbox_ffa.c | 3 --- drivers/gpio/gpio-uclass.c | 3 --- drivers/gpio/nx_gpio.c | 3 --- drivers/i2c/mxc_i2c.c | 3 --- drivers/i2c/nx_i2c.c | 3 --- drivers/i2c/ocores_i2c.c | 3 --- drivers/i2c/soft_i2c.c | 3 --- drivers/i2c/synquacer_i2c.c | 2 -- drivers/mailbox/imx-mailbox.c | 2 -- drivers/misc/atsha204a-i2c.c | 3 --- drivers/misc/fs_loader.c | 3 --- drivers/misc/imx8/fuse.c | 3 --- drivers/mmc/ca_dw_mmc.c | 3 --- drivers/mmc/f_sdh30.c | 2 -- drivers/mmc/jz_mmc.c | 3 --- drivers/mmc/msm_sdhci.c | 3 --- drivers/mmc/mv_sdhci.c | 3 --- drivers/mtd/nand/raw/pxa3xx_nand.c | 3 --- drivers/mtd/nand/raw/tegra_nand.c | 3 --- drivers/mtd/nvmxip/nvmxip_qspi.c | 3 --- drivers/mtd/spi/sf-uclass.c | 3 --- drivers/net/dwmac_s700.c | 3 --- drivers/net/fec_mxc.c | 3 --- drivers/net/gmac_rockchip.c | 2 -- drivers/net/mvneta.c | 3 --- drivers/net/octeontx/smi.c | 3 --- drivers/net/phy/fixed.c | 3 --- drivers/net/phy/phy.c | 3 --- drivers/net/phy/xilinx_gmii2rgmii.c | 3 --- drivers/net/sandbox-raw.c | 3 --- drivers/net/sandbox.c | 3 --- drivers/net/ti/keystone_net.c | 3 --- drivers/net/xilinx_axi_emac.c | 3 --- drivers/pci/pci_octeontx.c | 3 --- drivers/pci/pcie_dw_meson.c | 3 --- drivers/pci/pcie_dw_qcom.c | 3 --- drivers/pci/pcie_dw_rockchip.c | 3 --- drivers/pci/pcie_dw_ti.c | 3 --- drivers/pci/pcie_layerscape.c | 3 --- drivers/pci/pcie_layerscape.h | 4 +++- drivers/pci/pcie_starfive_jh7110.c | 3 --- drivers/pci_endpoint/pci_ep-uclass.c | 3 --- drivers/phy/marvell/comphy_core.c | 3 --- drivers/phy/omap-usb2-phy.c | 3 --- drivers/phy/rockchip/phy-rockchip-pcie.c | 3 --- drivers/phy/rockchip/phy-rockchip-typec.c | 3 --- drivers/pinctrl/mtmips/pinctrl-mt7628.c | 3 --- drivers/pinctrl/nexell/pinctrl-nexell.c | 3 --- drivers/pinctrl/nexell/pinctrl-s5pxx18.c | 3 --- drivers/pinctrl/nxp/pinctrl-imx-mmio.c | 3 --- drivers/pinctrl/nxp/pinctrl-imx.c | 3 --- drivers/pinctrl/nxp/pinctrl-imx8.c | 3 --- drivers/pinctrl/nxp/pinctrl-mxs.c | 3 --- drivers/power/domain/imx8m-power-domain.c | 3 --- drivers/power/pmic/bd71837.c | 3 --- drivers/power/pmic/mc34708.c | 3 --- drivers/power/pmic/mp5416.c | 3 --- drivers/power/pmic/pca9450.c | 3 --- drivers/power/regulator/pwm_regulator.c | 3 --- drivers/pwm/pwm-sifive.c | 3 --- drivers/pwm/rk_pwm.c | 3 --- drivers/pwm/sunxi_pwm.c | 3 --- drivers/ram/stm32mp1/stm32mp1_tests.c | 3 --- drivers/reboot-mode/reboot-mode-gpio.c | 2 -- drivers/reboot-mode/reboot-mode-rtc.c | 2 -- drivers/remoteproc/rproc-uclass.c | 2 -- drivers/serial/ns16550.c | 3 --- drivers/serial/sandbox.c | 3 --- drivers/serial/serial_adi_uart4.c | 2 -- drivers/serial/serial_htif.c | 3 --- drivers/serial/serial_xen.c | 3 --- drivers/smem/msm_smem.c | 3 --- drivers/spi/ca_sflash.c | 3 --- drivers/spi/microchip_coreqspi.c | 2 -- drivers/spi/mvebu_a3700_spi.c | 3 --- drivers/spi/omap3_spi.c | 3 --- drivers/spi/spi-sunxi.c | 3 --- drivers/spi/spi-synquacer.c | 2 -- drivers/spi/spi-uclass.c | 3 --- drivers/spi/tegra210_qspi.c | 3 --- drivers/spmi/spmi-msm.c | 3 --- drivers/thermal/imx_tmu.c | 3 --- drivers/timer/ostm_timer.c | 3 --- drivers/timer/sp804_timer.c | 3 --- drivers/usb/common/common.c | 3 --- drivers/usb/phy/rockchip_usb2_phy.c | 3 --- drivers/usb/tcpm/tcpm.c | 2 -- drivers/video/hx8238d.c | 2 -- drivers/video/imx/mxc_ipuv3_fb.c | 3 --- drivers/video/nexell_display.c | 3 --- drivers/video/rockchip/rk_lvds.c | 3 --- drivers/video/rockchip/rk_mipi.c | 3 --- drivers/video/sandbox_sdl.c | 3 --- drivers/video/tidss/tidss_drv.c | 2 -- drivers/video/zynqmp/zynqmp_dpsub.c | 3 --- drivers/watchdog/armada-37xx-wdt.c | 3 --- drivers/watchdog/at91sam9_wdt.c | 3 --- drivers/watchdog/mt7621_wdt.c | 3 --- drivers/watchdog/orion_wdt.c | 3 --- drivers/watchdog/sbsa_gwdt.c | 3 --- drivers/watchdog/wdt-uclass.c | 3 --- fs/fs.c | 3 --- fs/ubifs/ubifs.c | 3 --- include/relocate.h | 2 -- lib/efi_loader/efi_capsule.c | 3 --- lib/efi_loader/efi_gop.c | 3 --- lib/efi_loader/efi_rng.c | 3 --- net/eth-uclass.c | 3 --- net/tftp.c | 3 --- net/wget.c | 3 --- test/cmd/exit.c | 3 --- test/cmd/test_echo.c | 3 --- test/cmd/test_pause.c | 3 --- test/dm/blk.c | 3 --- test/dm/i3c.c | 2 -- test/lib/test_print.c | 3 --- test/log/log_filter.c | 4 +--- 300 files changed, 22 insertions(+), 851 deletions(-)
---
base-commit: c7fbe028ee5bc83df833a73e1491f1a483b65d98
change-id: 20260202-cleanup-560c900f7bc3
Best regards,
Signature · 1 line
Peng Fan <[email protected]>