]> git.baikalelectronics.ru Git - uboot.git/commit
common: dfu: Remove leading space characters
authorRavi Gunasekaran <r-gunasekaran@ti.com>
Thu, 18 May 2023 06:36:23 +0000 (12:06 +0530)
committerTom Rini <trini@konsulko.com>
Wed, 31 May 2023 21:23:01 +0000 (17:23 -0400)
commit44a61ccc961f5cb735d801193eacd1f104e9c494
tree24f4964b832ae567674df8380bf7eae496bb8991
parent7113c9e9d2e3a87edb012bb8882b3cedd7990ae1
common: dfu: Remove leading space characters

As per [1], dfu_alt_info is mentioned to be as semicolon separated
string of information on each alternate and the parsing logic in
the dfu.c is based on this.

Typically, the dfu_alt_info_* is defined in .h files as preprocessor
macros with 'alt' info separated by semicolon.

But when dfu_alt_info_* is added in the environment files(.env)
the script at "scripts/env2string.awk" converts a newline to space.
Thus adding a space character after semicolon. This results in
incorrect parsing in dfu.c which is based on the information that
'alt' info are only semicolon separated.

One option is to add dfu_alt_info_* variable in .env in single line.
But there is possiblity for it to exceed the line length limit.
So update the parsing logic to remove leading space characters
before adding to the dfu list.

[1]: https://u-boot.readthedocs.io/en/latest/usage/dfu.html

Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
drivers/dfu/dfu.c