diff mbox

[U-Boot,v1,7/8] rockchip: mkimage: remove placeholder functions from rkimage

Message ID 1492444088-52864-8-git-send-email-philipp.tomsich@theobroma-systems.com
State Accepted
Commit 253c60a557d6740f15169a1f15772d7e64928d9b
Delegated to: Simon Glass
Headers show

Commit Message

Philipp Tomsich April 17, 2017, 3:48 p.m. UTC
The imagetool framework checks whether function pointer for the verify,
print and extract actions are available and will will handle their
absence appropriately.

This change removes the unnecessary functions and uses the driver
structure to convey available functionality to imagetool.  This is in
fact better than having verify just return 0 (which previously broke
dumpimage, as dumpimage assumed that we had handled the image and did
not continue to probe further).

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---

 tools/rkimage.c | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)

Comments

Simon Glass April 18, 2017, 4 a.m. UTC | #1
On 17 April 2017 at 09:48, Philipp Tomsich <
philipp.tomsich@theobroma-systems.com> wrote:
> The imagetool framework checks whether function pointer for the verify,
> print and extract actions are available and will will handle their
> absence appropriately.
>
> This change removes the unnecessary functions and uses the driver
> structure to convey available functionality to imagetool. This is in
> fact better than having verify just return 0 (which previously broke
> dumpimage, as dumpimage assumed that we had handled the image and did
> not continue to probe further).
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>
> tools/rkimage.c | 21 +++------------------
> 1 file changed, 3 insertions(+), 18 deletions(-)

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass April 20, 2017, 9:06 p.m. UTC | #2
On 17 April 2017 at 22:00, Simon Glass <sjg@chromium.org> wrote:
> On 17 April 2017 at 09:48, Philipp Tomsich
> <philipp.tomsich@theobroma-systems.com> wrote:
>> The imagetool framework checks whether function pointer for the verify,
>> print and extract actions are available and will will handle their
>> absence appropriately.
>>
>> This change removes the unnecessary functions and uses the driver
>> structure to convey available functionality to imagetool. This is in
>> fact better than having verify just return 0 (which previously broke
>> dumpimage, as dumpimage assumed that we had handled the image and did
>> not continue to probe further).
>>
>> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>> ---
>>
>> tools/rkimage.c | 21 +++------------------
>> 1 file changed, 3 insertions(+), 18 deletions(-)
>
> Acked-by: Simon Glass <sjg@chromium.org>

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

Patch

diff --git a/tools/rkimage.c b/tools/rkimage.c
index 44d098c..9880b15 100644
--- a/tools/rkimage.c
+++ b/tools/rkimage.c
@@ -13,16 +13,6 @@ 
 
 static uint32_t header;
 
-static int rkimage_verify_header(unsigned char *buf, int size,
-				 struct image_tool_params *params)
-{
-	return 0;
-}
-
-static void rkimage_print_header(const void *buf)
-{
-}
-
 static void rkimage_set_header(void *buf, struct stat *sbuf, int ifd,
 			       struct image_tool_params *params)
 {
@@ -33,11 +23,6 @@  static void rkimage_set_header(void *buf, struct stat *sbuf, int ifd,
 		rkcommon_rc4_encode_spl(buf, 4, params->file_size);
 }
 
-static int rkimage_extract_subimage(void *buf, struct image_tool_params *params)
-{
-	return 0;
-}
-
 static int rkimage_check_image_type(uint8_t type)
 {
 	if (type == IH_TYPE_RKIMAGE)
@@ -55,10 +40,10 @@  U_BOOT_IMAGE_TYPE(
 	4,
 	&header,
 	rkcommon_check_params,
-	rkimage_verify_header,
-	rkimage_print_header,
+	NULL,
+	NULL,
 	rkimage_set_header,
-	rkimage_extract_subimage,
+	NULL,
 	rkimage_check_image_type,
 	NULL,
 	NULL