ACK: [PATCH 6/6 V2] efi_runtime: expand to a full if-conditional instead of using terneary operator
Alex Hung
alex.hung at canonical.com
Tue Aug 23 01:38:51 UTC 2016
On 2016-08-19 05:18 PM, Ivan Hu wrote:
> Signed-off-by: Ivan Hu <ivan.hu at 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 at canonical.com>
More information about the fwts-devel
mailing list