[3/4] swupdate: check_provided: use flag NO_DATA_HANDLER
diff mbox series

Message ID 1563204929-2762-4-git-send-email-philippe.reynes@softathome.com
State Accepted
Headers show
Series
  • handlers: add a flag NO_DATA_HANDLER
Related show

Commit Message

Philippe REYNES July 15, 2019, 3:35 p.m. UTC
This commit clean the code of function check_provided,
instead of comparing the name with strcmp, we simply
check the flag NO_DATA_HANDLER.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
---
 core/swupdate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Babic July 16, 2019, 2:33 p.m. UTC | #1
On 15/07/19 17:35, Philippe Reynes wrote:
> This commit clean the code of function check_provided,
> instead of comparing the name with strcmp, we simply
> check the flag NO_DATA_HANDLER.
> 
> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
> ---
>  core/swupdate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/core/swupdate.c b/core/swupdate.c
> index b9f7676..58218d0 100644
> --- a/core/swupdate.c
> +++ b/core/swupdate.c
> @@ -175,7 +175,7 @@ static int check_provided(struct imglist *list)
>  
>  	for (p = list->lh_first; p != NULL;
>  		p = p->next.le_next) {
> -		if (!p->provided && strcmp(p->type,"ubiswap")) {
> +		if (!p->provided && !(get_handler_mask(p) & NO_DATA_HANDLER)) {
>  			ERROR("Requested file not found in image: %s", \
>  				p->fname);
>  			ret = -1;
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

Patch
diff mbox series

diff --git a/core/swupdate.c b/core/swupdate.c
index b9f7676..58218d0 100644
--- a/core/swupdate.c
+++ b/core/swupdate.c
@@ -175,7 +175,7 @@  static int check_provided(struct imglist *list)
 
 	for (p = list->lh_first; p != NULL;
 		p = p->next.le_next) {
-		if (!p->provided && strcmp(p->type,"ubiswap")) {
+		if (!p->provided && !(get_handler_mask(p) & NO_DATA_HANDLER)) {
 			ERROR("Requested file not found in image: %s", \
 				p->fname);
 			ret = -1;