diff mbox series

[3/4] xilinx: zynqmp: Move dfu.h include to be with the code

Message ID 20230817174125.369849-3-trini@konsulko.com
State Deferred
Delegated to: Tom Rini
Headers show
Series [1/4] usb: gadget: g_dnl.c: Drop unused includes | expand

Commit Message

Tom Rini Aug. 17, 2023, 5:41 p.m. UTC
Move where we include <dfu.h> to be guarded by a DFU-related Kconfig
option.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
This becomes an issue with
https://patchwork.ozlabs.org/project/uboot/patch/20220620111354.448512-1-jh80.chung@samsung.com/
applied as now we can't include <dfu.h> without CONFIG_DFU_NAME_MAX_SIZE
set (or we have a dummy value for ifndef).  Another option would be to
restructure the code to move the dfu code to another file, but I don't
know if that will make the rest of the real use cases here easier or
harder.

Cc: Michal Simek <michal.simek@amd.com>
---
 board/xilinx/zynqmp/zynqmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Simek Aug. 21, 2023, 11:59 a.m. UTC | #1
On 8/17/23 19:41, Tom Rini wrote:
> Move where we include <dfu.h> to be guarded by a DFU-related Kconfig
> option.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> This becomes an issue with
> https://patchwork.ozlabs.org/project/uboot/patch/20220620111354.448512-1-jh80.chung@samsung.com/
> applied as now we can't include <dfu.h> without CONFIG_DFU_NAME_MAX_SIZE
> set (or we have a dummy value for ifndef).  Another option would be to
> restructure the code to move the dfu code to another file, but I don't
> know if that will make the rest of the real use cases here easier or
> harder.
> 
> Cc: Michal Simek <michal.simek@amd.com>
> ---
>   board/xilinx/zynqmp/zynqmp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index 309f24a5f43d..367c3c65a9dc 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -8,7 +8,6 @@
>   #include <command.h>
>   #include <cpu_func.h>
>   #include <debug_uart.h>
> -#include <dfu.h>
>   #include <env.h>
>   #include <env_internal.h>
>   #include <init.h>
> @@ -606,6 +605,7 @@ enum env_location env_get_location(enum env_operation op, int prio)
>   }
>   
>   #if defined(CONFIG_SET_DFU_ALT_INFO)
> +#include <dfu.h>
>   
>   #define DFU_ALT_BUF_LEN		SZ_1K
>   

Reviewed-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal
diff mbox series

Patch

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 309f24a5f43d..367c3c65a9dc 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -8,7 +8,6 @@ 
 #include <command.h>
 #include <cpu_func.h>
 #include <debug_uart.h>
-#include <dfu.h>
 #include <env.h>
 #include <env_internal.h>
 #include <init.h>
@@ -606,6 +605,7 @@  enum env_location env_get_location(enum env_operation op, int prio)
 }
 
 #if defined(CONFIG_SET_DFU_ALT_INFO)
+#include <dfu.h>
 
 #define DFU_ALT_BUF_LEN		SZ_1K