diff mbox

uefirttime: specify enable to true for setwakeuptime wiht null time test

Message ID 1472626982-27852-1-git-send-email-ivan.hu@canonical.com
State Accepted
Headers show

Commit Message

Ivan Hu Aug. 31, 2016, 7:03 a.m. UTC
UEFI spec. allows the Time parameter for SetWakeupTime to be NULL when the
enable is false, so here sould set enable to true for testing NULL time
parameter.

From spec.
typedef EFI_STATUS
SetWakeupTime (IN BOOLEAN Enable, IN EFI_TIME *Time OPTIONAL);

If Enable is TRUE, the time to set the wakeup alarm for. Type
EFI_TIME is defined in the GetTime() function description.
If Enable is FALSE, then this parameter is optional, and may be
NULL.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/uefi/uefirttime/uefirttime.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Colin Ian King Aug. 31, 2016, 7:07 a.m. UTC | #1
On 31/08/16 08:03, Ivan Hu wrote:
> UEFI spec. allows the Time parameter for SetWakeupTime to be NULL when the
> enable is false, so here sould set enable to true for testing NULL time
> parameter.
> 
> From spec.
> typedef EFI_STATUS
> SetWakeupTime (IN BOOLEAN Enable, IN EFI_TIME *Time OPTIONAL);
> 
> If Enable is TRUE, the time to set the wakeup alarm for. Type
> EFI_TIME is defined in the GetTime() function description.
> If Enable is FALSE, then this parameter is optional, and may be
> NULL.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/uefi/uefirttime/uefirttime.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
> index 55e9d19..c48a18b 100644
> --- a/src/uefi/uefirttime/uefirttime.c
> +++ b/src/uefi/uefirttime/uefirttime.c
> @@ -877,6 +877,7 @@ static int uefirttime_test24(fwts_framework *fw)
>  {
>  	struct efi_setwakeuptime setwakeuptime;
>  
> +	setwakeuptime.Enabled = true;
>  	setwakeuptime.Time = NULL;
>  	return uefirttime_test_setwakeuptime_invalid(fw, &setwakeuptime);
>  }
> 
Thanks Ivan

Acked-by: Colin Ian King <colin.king@canonical.com>
Alex Hung Aug. 31, 2016, 7:20 a.m. UTC | #2
On 08/31/2016 03:03 PM, Ivan Hu wrote:
> UEFI spec. allows the Time parameter for SetWakeupTime to be NULL when the
> enable is false, so here sould set enable to true for testing NULL time
> parameter.
>
> From spec.
> typedef EFI_STATUS
> SetWakeupTime (IN BOOLEAN Enable, IN EFI_TIME *Time OPTIONAL);
>
> If Enable is TRUE, the time to set the wakeup alarm for. Type
> EFI_TIME is defined in the GetTime() function description.
> If Enable is FALSE, then this parameter is optional, and may be
> NULL.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/uefi/uefirttime/uefirttime.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
> index 55e9d19..c48a18b 100644
> --- a/src/uefi/uefirttime/uefirttime.c
> +++ b/src/uefi/uefirttime/uefirttime.c
> @@ -877,6 +877,7 @@ static int uefirttime_test24(fwts_framework *fw)
>  {
>  	struct efi_setwakeuptime setwakeuptime;
>
> +	setwakeuptime.Enabled = true;
>  	setwakeuptime.Time = NULL;
>  	return uefirttime_test_setwakeuptime_invalid(fw, &setwakeuptime);
>  }
>

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

Patch

diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c
index 55e9d19..c48a18b 100644
--- a/src/uefi/uefirttime/uefirttime.c
+++ b/src/uefi/uefirttime/uefirttime.c
@@ -877,6 +877,7 @@  static int uefirttime_test24(fwts_framework *fw)
 {
 	struct efi_setwakeuptime setwakeuptime;
 
+	setwakeuptime.Enabled = true;
 	setwakeuptime.Time = NULL;
 	return uefirttime_test_setwakeuptime_invalid(fw, &setwakeuptime);
 }