diff mbox series

[5/7] imx8image: Remove unused cont_img_count variable

Message ID 20230227220839.2519733-5-trini@konsulko.com
State Accepted
Commit a6b8dd8a12bc983ff48ebca2b63cf95baf4dfd74
Delegated to: Tom Rini
Headers show
Series [1/7] global: Disable deprecated-non-prototype warning with clang | expand

Commit Message

Tom Rini Feb. 27, 2023, 10:08 p.m. UTC
With clang-15, it is now reported that cont_img_count is unused. This is
true as the code will increment / reset this counter, but never
functionally use it. Remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>
---
 tools/imx8image.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Simon Glass Feb. 28, 2023, 12:35 a.m. UTC | #1
On Mon, 27 Feb 2023 at 15:09, Tom Rini <trini@konsulko.com> wrote:
>
> With clang-15, it is now reported that cont_img_count is unused. This is
> true as the code will increment / reset this counter, but never
> functionally use it. Remove it.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Cc: Peng Fan <peng.fan@nxp.com>
> Cc: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>
> ---
>  tools/imx8image.c | 5 -----
>  1 file changed, 5 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>
Fabio Estevam Feb. 28, 2023, 4:12 p.m. UTC | #2
On Mon, Feb 27, 2023 at 7:08 PM Tom Rini <trini@konsulko.com> wrote:
>
> With clang-15, it is now reported that cont_img_count is unused. This is
> true as the code will increment / reset this counter, but never
> functionally use it. Remove it.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>

Reviewed-by: Fabio Estevam <festevam@denx.de>
Peng Fan (OSS) March 1, 2023, 12:56 a.m. UTC | #3
On 2/28/2023 6:08 AM, Tom Rini wrote:
> With clang-15, it is now reported that cont_img_count is unused. This is
> true as the code will increment / reset this counter, but never
> functionally use it. Remove it.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> ---
> Cc: Peng Fan <peng.fan@nxp.com>
> Cc: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>
> ---
>   tools/imx8image.c | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/tools/imx8image.c b/tools/imx8image.c
> index 395d5c64bdf0..c25ea84e25c5 100644
> --- a/tools/imx8image.c
> +++ b/tools/imx8image.c
> @@ -829,7 +829,6 @@ static int build_container(soc_type_t soc, uint32_t sector_size,
>   	int ret;
>   
>   	int container = -1;
> -	int cont_img_count = 0; /* indexes to arrange the container */
>   
>   	memset((char *)&imx_header, 0, sizeof(imx_header_v3_t));
>   
> @@ -879,7 +878,6 @@ static int build_container(soc_type_t soc, uint32_t sector_size,
>   			img_sp->src = file_off;
>   
>   			file_off += ALIGN(sbuf.st_size, sector_size);
> -			cont_img_count++;
>   			break;
>   
>   		case SECO:
> @@ -899,7 +897,6 @@ static int build_container(soc_type_t soc, uint32_t sector_size,
>   			img_sp->src = file_off;
>   
>   			file_off += sbuf.st_size;
> -			cont_img_count++;
>   			break;
>   
>   		case NEW_CONTAINER:
> @@ -908,8 +905,6 @@ static int build_container(soc_type_t soc, uint32_t sector_size,
>   				      CONTAINER_ALIGNMENT,
>   				      CONTAINER_FLAGS_DEFAULT,
>   				      fuse_version);
> -			/* reset img count when moving to new container */
> -			cont_img_count = 0;
>   			scfw_flags = 0;
>   			break;
>
Tom Rini March 23, 2023, 1:18 a.m. UTC | #4
On Mon, Feb 27, 2023 at 05:08:37PM -0500, Tom Rini wrote:

> With clang-15, it is now reported that cont_img_count is unused. This is
> true as the code will increment / reset this counter, but never
> functionally use it. Remove it.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Fabio Estevam <festevam@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/tools/imx8image.c b/tools/imx8image.c
index 395d5c64bdf0..c25ea84e25c5 100644
--- a/tools/imx8image.c
+++ b/tools/imx8image.c
@@ -829,7 +829,6 @@  static int build_container(soc_type_t soc, uint32_t sector_size,
 	int ret;
 
 	int container = -1;
-	int cont_img_count = 0; /* indexes to arrange the container */
 
 	memset((char *)&imx_header, 0, sizeof(imx_header_v3_t));
 
@@ -879,7 +878,6 @@  static int build_container(soc_type_t soc, uint32_t sector_size,
 			img_sp->src = file_off;
 
 			file_off += ALIGN(sbuf.st_size, sector_size);
-			cont_img_count++;
 			break;
 
 		case SECO:
@@ -899,7 +897,6 @@  static int build_container(soc_type_t soc, uint32_t sector_size,
 			img_sp->src = file_off;
 
 			file_off += sbuf.st_size;
-			cont_img_count++;
 			break;
 
 		case NEW_CONTAINER:
@@ -908,8 +905,6 @@  static int build_container(soc_type_t soc, uint32_t sector_size,
 				      CONTAINER_ALIGNMENT,
 				      CONTAINER_FLAGS_DEFAULT,
 				      fuse_version);
-			/* reset img count when moving to new container */
-			cont_img_count = 0;
 			scfw_flags = 0;
 			break;