diff mbox series

[v3,01/17] common: update_tftp: remove unnecessary build check

Message ID 20200710012537.6264-2-takahiro.akashi@linaro.org
State Superseded
Headers show
Series efi_loader: add capsule update support | expand

Commit Message

AKASHI Takahiro July 10, 2020, 1:25 a.m. UTC
Logically, the current update_tftp() should and does compile and work
correctly even without satisfying the following condition:

> #if defined(CONFIG_UPDATE_TFTP) && !defined(CONFIG_MTD_NOR_FLASH)
> #error "CONFIG_UPDATE_TFTP and !CONFIG_MTD_NOR_FLASH needed for
>  legacy behaviour"
> #endif

It would be better to just drop it so that this function will be
used on wider range of platforms.

Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
---
 common/update.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Heinrich Schuchardt July 10, 2020, 5:38 a.m. UTC | #1
On 7/10/20 3:25 AM, AKASHI Takahiro wrote:
> Logically, the current update_tftp() should and does compile and work
> correctly even without satisfying the following condition:
>
>> #if defined(CONFIG_UPDATE_TFTP) && !defined(CONFIG_MTD_NOR_FLASH)
>> #error "CONFIG_UPDATE_TFTP and !CONFIG_MTD_NOR_FLASH needed for
>>  legacy behaviour"
>> #endif

The file update.c is for the auto update feature. This should be
completely orthogonal to UEFI capsule updates.

We need UEFI capsule updates to work without network. It should not
depend on UPDATE_TFTP and not on NET.

Best regards

Heinrich

>
> It would be better to just drop it so that this function will be
> used on wider range of platforms.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
> ---
>  common/update.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/common/update.c b/common/update.c
> index c8dd346a0956..3547dc68bf7c 100644
> --- a/common/update.c
> +++ b/common/update.c
> @@ -14,10 +14,6 @@
>  #error "CONFIG_FIT and CONFIG_OF_LIBFDT are required for auto-update feature"
>  #endif
>
> -#if defined(CONFIG_UPDATE_TFTP) && !defined(CONFIG_MTD_NOR_FLASH)
> -#error "CONFIG_UPDATE_TFTP and !CONFIG_MTD_NOR_FLASH needed for legacy behaviour"
> -#endif
> -
>  #include <command.h>
>  #include <env.h>
>  #include <flash.h>
> @@ -210,8 +206,10 @@ static int update_flash(ulong addr_source, ulong addr_first, ulong size)
>  		printf("Error: could not protect flash sectors\n");
>  		return 1;
>  	}
> -#endif
>  	return 0;
> +#else
> +	return 1;
> +#endif
>  }
>
>  static int update_fit_getparams(const void *fit, int noffset, ulong *addr,
>
diff mbox series

Patch

diff --git a/common/update.c b/common/update.c
index c8dd346a0956..3547dc68bf7c 100644
--- a/common/update.c
+++ b/common/update.c
@@ -14,10 +14,6 @@ 
 #error "CONFIG_FIT and CONFIG_OF_LIBFDT are required for auto-update feature"
 #endif
 
-#if defined(CONFIG_UPDATE_TFTP) && !defined(CONFIG_MTD_NOR_FLASH)
-#error "CONFIG_UPDATE_TFTP and !CONFIG_MTD_NOR_FLASH needed for legacy behaviour"
-#endif
-
 #include <command.h>
 #include <env.h>
 #include <flash.h>
@@ -210,8 +206,10 @@  static int update_flash(ulong addr_source, ulong addr_first, ulong size)
 		printf("Error: could not protect flash sectors\n");
 		return 1;
 	}
-#endif
 	return 0;
+#else
+	return 1;
+#endif
 }
 
 static int update_fit_getparams(const void *fit, int noffset, ulong *addr,