diff mbox series

[1/1] tools/imximage: accept // as comment line start

Message ID 20200412145840.32672-1-xypron.glpk@gmx.de
State New
Headers show
Series [1/1] tools/imximage: accept // as comment line start | expand

Commit Message

Heinrich Schuchardt April 12, 2020, 2:58 p.m. UTC
arch/arm/mach-imx/spl_sd.cfg contains comments. These cannot be parsed by
'mkimage -T imximage'. We cannot use '#' in spl_sd.cfg as this leads to
a build error. So let's use "//" to mark comment lines.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 arch/arm/mach-imx/spl_qspi.cfg | 14 +++++++-------
 arch/arm/mach-imx/spl_sd.cfg   | 14 +++++++-------
 tools/imximage.c               |  7 +++++--
 3 files changed, 19 insertions(+), 16 deletions(-)

--
2.25.1

Comments

Heinrich Schuchardt April 12, 2020, 3:16 p.m. UTC | #1
On 4/12/20 4:58 PM, Heinrich Schuchardt wrote:
> arch/arm/mach-imx/spl_sd.cfg contains comments. These cannot be parsed by
> 'mkimage -T imximage'. We cannot use '#' in spl_sd.cfg as this leads to
> a build error. So let's use "//" to mark comment lines.
>

Did I get it wrong? There is also a generated spl/u-boot-spl.cfgout. But
that is not mentioned in any README.

Best regards

Heinrich

> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
>  arch/arm/mach-imx/spl_qspi.cfg | 14 +++++++-------
>  arch/arm/mach-imx/spl_sd.cfg   | 14 +++++++-------
>  tools/imximage.c               |  7 +++++--
>  3 files changed, 19 insertions(+), 16 deletions(-)
>
> diff --git a/arch/arm/mach-imx/spl_qspi.cfg b/arch/arm/mach-imx/spl_qspi.cfg
> index 88956e626f..6e79adb0da 100644
> --- a/arch/arm/mach-imx/spl_qspi.cfg
> +++ b/arch/arm/mach-imx/spl_qspi.cfg
> @@ -1,7 +1,7 @@
> -/* SPDX-License-Identifier: GPL-2.0+ */
> -/*
> - * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
> - */
> +// SPDX-License-Identifier: GPL-2.0+
> +//
> +// Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
> +//
>
>  #define __ASSEMBLY__
>  #include <config.h>
> @@ -9,9 +9,9 @@
>  IMAGE_VERSION	2
>  BOOT_FROM	qspi
>
> -/*
> - * Secure boot support
> - */
> +//
> +// Secure boot support
> +//
>  #ifdef CONFIG_SECURE_BOOT
>  CSF CONFIG_CSF_SIZE
>  #endif
> diff --git a/arch/arm/mach-imx/spl_sd.cfg b/arch/arm/mach-imx/spl_sd.cfg
> index dbaee81535..b14becc2ce 100644
> --- a/arch/arm/mach-imx/spl_sd.cfg
> +++ b/arch/arm/mach-imx/spl_sd.cfg
> @@ -1,7 +1,7 @@
> -/* SPDX-License-Identifier: GPL-2.0+ */
> -/*
> - * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
> - */
> +// SPDX-License-Identifier: GPL-2.0+
> +//
> +// Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
> +//
>
>  #define __ASSEMBLY__
>  #include <config.h>
> @@ -9,9 +9,9 @@
>  IMAGE_VERSION	2
>  BOOT_FROM	sd
>
> -/*
> - * Secure boot support
> - */
> +//
> +// Secure boot support
> +//
>  #ifdef CONFIG_IMX_HAB
>  CSF CONFIG_CSF_SIZE
>  #endif
> diff --git a/tools/imximage.c b/tools/imximage.c
> index d7edd3c52f..4f62d57790 100644
> --- a/tools/imximage.c
> +++ b/tools/imximage.c
> @@ -772,8 +772,11 @@ static uint32_t parse_cfg_file(struct imx_header *imxhdr, char *name)
>  			if (token == NULL)
>  				break;
>
> -			/* Drop all text starting with '#' as comments */
> -			if (token[0] == '#')
> +			/*
> +			 * Drop all text starting with '#' or "//" as comments
> +			 */
> +			if (token[0] == '#' ||
> +			    (token[0] == '/' && token[1] == '/'))
>  				break;
>
>  			parse_cfg_fld(imxhdr, &cmd, token, name,
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/spl_qspi.cfg b/arch/arm/mach-imx/spl_qspi.cfg
index 88956e626f..6e79adb0da 100644
--- a/arch/arm/mach-imx/spl_qspi.cfg
+++ b/arch/arm/mach-imx/spl_qspi.cfg
@@ -1,7 +1,7 @@ 
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
- */
+// SPDX-License-Identifier: GPL-2.0+
+//
+// Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+//

 #define __ASSEMBLY__
 #include <config.h>
@@ -9,9 +9,9 @@ 
 IMAGE_VERSION	2
 BOOT_FROM	qspi

-/*
- * Secure boot support
- */
+//
+// Secure boot support
+//
 #ifdef CONFIG_SECURE_BOOT
 CSF CONFIG_CSF_SIZE
 #endif
diff --git a/arch/arm/mach-imx/spl_sd.cfg b/arch/arm/mach-imx/spl_sd.cfg
index dbaee81535..b14becc2ce 100644
--- a/arch/arm/mach-imx/spl_sd.cfg
+++ b/arch/arm/mach-imx/spl_sd.cfg
@@ -1,7 +1,7 @@ 
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
- */
+// SPDX-License-Identifier: GPL-2.0+
+//
+// Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+//

 #define __ASSEMBLY__
 #include <config.h>
@@ -9,9 +9,9 @@ 
 IMAGE_VERSION	2
 BOOT_FROM	sd

-/*
- * Secure boot support
- */
+//
+// Secure boot support
+//
 #ifdef CONFIG_IMX_HAB
 CSF CONFIG_CSF_SIZE
 #endif
diff --git a/tools/imximage.c b/tools/imximage.c
index d7edd3c52f..4f62d57790 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -772,8 +772,11 @@  static uint32_t parse_cfg_file(struct imx_header *imxhdr, char *name)
 			if (token == NULL)
 				break;

-			/* Drop all text starting with '#' as comments */
-			if (token[0] == '#')
+			/*
+			 * Drop all text starting with '#' or "//" as comments
+			 */
+			if (token[0] == '#' ||
+			    (token[0] == '/' && token[1] == '/'))
 				break;

 			parse_cfg_fld(imxhdr, &cmd, token, name,