From 48404723193c24f9d38948e520aa3d0f7a492544 Mon Sep 17 00:00:00 2001 From: Vijay Banerjee Date: Mon, 20 Jul 2026 10:27:50 -0500 Subject: [PATCH] shared/u-boot: Cleanup unused function This commit adds 'HAS_UBOOT' conditional to 'bsp_uboot_getenv' to match the bsp.h file. This fixes the following errors: error: home/tester/bsps/powerpc/shared/u-boot/uboot_getenv.c:73:13: error: no previous prototype for 'bsp_uboot_getenv' [-Werror=missing-prototypes] Updates #5481 --- bsps/powerpc/shared/u-boot/uboot_getenv.c | 24 ++--------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/bsps/powerpc/shared/u-boot/uboot_getenv.c b/bsps/powerpc/shared/u-boot/uboot_getenv.c index d0fc4ad955..e613040c49 100644 --- a/bsps/powerpc/shared/u-boot/uboot_getenv.c +++ b/bsps/powerpc/shared/u-boot/uboot_getenv.c @@ -48,28 +48,7 @@ const uint8_t *uboot_environment = (const uint8_t *) UBOOT_ENV_BASE; const size_t uboot_environment_size = UBOOT_ENV_SIZE; -/* - * The U-Boot source code appears to use the CRC32 code from zlib. - * But I cannot find a way to get the crc32() in zlib code to - * generate the CRC found in the Flash on the Icecube board. - * So for now, always return TRUE. - */ -static int bsp_uboot_environ_check_crc(void) -{ -#if 0 - unsigned long crc; - unsigned long max; - - for (max=0 ; max <= 0x20000 ; max+=4 ) { - crc = crc32( 0, NULL, 0 ); - crc = crc32( crc, &uboot_environment[4], max); - printk( "crc=0x%08lx need %0x max=%d\n", crc, - *(int *)uboot_environment, max ); - } -#endif - return 1; -} - +#if defined(HAS_UBOOT) const char *bsp_uboot_getenv( const char *name ) @@ -96,4 +75,5 @@ const char *bsp_uboot_getenv( } return NULL; } +#endif