[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fwts-devel
Subject:    ACK: [PATCH 6/6 V2] efi_runtime: expand to a full if-conditional instead of using terneary operator
From:       Alex Hung <alex.hung () canonical ! com>
Date:       2016-08-23 1:38:51
Message-ID: eabc79e2-95df-0b56-bf8f-2153ff1bf522 () canonical ! com
[Download RAW message or body]

On 2016-08-19 05:18 PM, Ivan Hu wrote:
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  efi_runtime/efi_runtime.c | 21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/efi_runtime/efi_runtime.c b/efi_runtime/efi_runtime.c
> index 6f8e096..5ac9781 100644
> --- a/efi_runtime/efi_runtime.c
> +++ b/efi_runtime/efi_runtime.c
> @@ -333,10 +333,12 @@ static long efi_runtime_get_time(unsigned long arg)
>  			put_user(cap.sets_to_zero, &(cap_local->sets_to_zero)))
>  			return -EFAULT;
>  	}
> -	if (gettime.time)
> -		return copy_to_user(gettime.time, &efi_time,
> -			sizeof(efi_time_t)) ? -EFAULT : 0;
> -	return 0;
> +	if (gettime.time) {
> +		if(copy_to_user(gettime.time, &efi_time, sizeof(efi_time_t)))
> +			return -EFAULT;
> +	}
> +
> +	return status == EFI_SUCCESS ? 0 : -EINVAL;
>  }
>
>  static long efi_runtime_set_time(unsigned long arg)
> @@ -386,10 +388,13 @@ static long efi_runtime_get_waketime(unsigned long arg)
>  						getwakeuptime.enabled))
>  		return -EFAULT;
>
> -	if (getwakeuptime.time)
> -		return copy_to_user(getwakeuptime.time, &efi_time,
> -			sizeof(efi_time_t)) ? -EFAULT : 0;
> -	return 0;
> +	if (getwakeuptime.time) {
> +		if (copy_to_user(getwakeuptime.time, &efi_time,
> +				sizeof(efi_time_t)))
> +			return -EFAULT;
> +	}
> +
> +	return status == EFI_SUCCESS ? 0 : -EINVAL;
>  }
>
>  static long efi_runtime_set_waketime(unsigned long arg)
>

Acked-by: Alex Hung <alex.hung@canonical.com>

-- 
fwts-devel mailing list
fwts-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic