On 13.11.22 11:20, Christian Storm wrote:
> From: Christian Storm <[email protected]>
> 
> Hard-coding the ustate values hurts readability and maintainability.
> Hence, use their existing #define'd names.
> While at it, fix a non-sense comment.
> 
> Signed-off-by: Christian Storm <[email protected]>
> ---
>  env/env_api.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/env/env_api.c b/env/env_api.c
> index 6ecd24d..173b764 100644
> --- a/env/env_api.c
> +++ b/env/env_api.c
> @@ -144,9 +144,9 @@ uint32_t ebg_env_user_free(ebgenv_t *e)
>  uint16_t ebg_env_getglobalstate(ebgenv_t *e)
>  {
>       BGENV *env;
> -     int res = 4;
> +     int res = USTATE_UNKNOWN;
>  
> -     /* find all environments with revision 0 */
> +     /* Test for rolled-back condition. */
>       for (int i = 0; i < ENV_NUM_CONFIG_PARTS; i++) {
>               env = bgenv_open_by_index(i);
>  
> @@ -158,10 +158,10 @@ uint16_t ebg_env_getglobalstate(ebgenv_t *e)
>                * with ustate == USTATE_FAILED */
>               if (env->data->revision == REVISION_FAILED &&
>                   env->data->ustate == USTATE_FAILED) {
> -                     res = 3;
> +                     res = USTATE_FAILED;
>               }
>               bgenv_close(env);
> -             if (res == 3) {
> +             if (res == USTATE_FAILED) {
>                       return res;
>               }
>       }

Thanks, applied.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/ee0bec57-9571-c81c-92f9-a996d2eab505%40siemens.com.

Reply via email to