diff mbox series

[u-boot-marvell,v2,20/20] tools: kwbimage: Fix mkimage/dumpimage -l argument

Message ID 20220112172054.5961-21-pali@kernel.org
State Accepted
Commit 32860b00bf2cb441c5b9b396d41c84aac340d7ad
Delegated to: Stefan Roese
Headers show
Series tools: kwbimage: Load address fixes | expand

Commit Message

Pali Rohár Jan. 12, 2022, 5:20 p.m. UTC
Do not check for kwbimage configuration file when just showing information
about existing kwbimage file.

The check for kwbimage configuration file is required only when creating
kwbimage, not when showing information about image or when extracting data
from image.

With this change, it is possible to call mkimage -l and dumpimage -l also
for existing kwbimage file.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
---
 tools/kwbimage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Stefan Roese Jan. 13, 2022, 6:46 a.m. UTC | #1
On 1/12/22 18:20, Pali Rohár wrote:
> Do not check for kwbimage configuration file when just showing information
> about existing kwbimage file.
> 
> The check for kwbimage configuration file is required only when creating
> kwbimage, not when showing information about image or when extracting data
> from image.
> 
> With this change, it is possible to call mkimage -l and dumpimage -l also
> for existing kwbimage file.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> Reviewed-by: Marek Behún <marek.behun@nic.cz>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
>   tools/kwbimage.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/kwbimage.c b/tools/kwbimage.c
> index d159087d9dd6..9b63ce80ff4e 100644
> --- a/tools/kwbimage.c
> +++ b/tools/kwbimage.c
> @@ -2331,7 +2331,8 @@ static int kwbimage_extract_subimage(void *ptr, struct image_tool_params *params
>    */
>   static int kwbimage_check_params(struct image_tool_params *params)
>   {
> -	if (!params->iflag && (!params->imagename || !strlen(params->imagename))) {
> +	if (!params->lflag && !params->iflag &&
> +	    (!params->imagename || !strlen(params->imagename))) {
>   		char *msg = "Configuration file for kwbimage creation omitted";
>   
>   		fprintf(stderr, "Error:%s - %s\n", params->cmdname, msg);
> 

Viele Grüße,
Stefan Roese
diff mbox series

Patch

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index d159087d9dd6..9b63ce80ff4e 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -2331,7 +2331,8 @@  static int kwbimage_extract_subimage(void *ptr, struct image_tool_params *params
  */
 static int kwbimage_check_params(struct image_tool_params *params)
 {
-	if (!params->iflag && (!params->imagename || !strlen(params->imagename))) {
+	if (!params->lflag && !params->iflag &&
+	    (!params->imagename || !strlen(params->imagename))) {
 		char *msg = "Configuration file for kwbimage creation omitted";
 
 		fprintf(stderr, "Error:%s - %s\n", params->cmdname, msg);