diff mbox series

fwts_acpica: skip unneccessary null check

Message ID 20220115041458.697148-1-alex.hung@canonical.com
State Accepted
Headers show
Series fwts_acpica: skip unneccessary null check | expand

Commit Message

Alex Hung Jan. 15, 2022, 4:14 a.m. UTC
Buglink: https://bugs.launchpad.net/bugs/1952671

"context" is always passed as NULL so it should not be used or checked.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/libfwtsacpica/fwts_acpica.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

ivanhu Jan. 17, 2022, 4:05 a.m. UTC | #1
On 1/15/22 12:14 PM, Alex Hung wrote:
> Buglink: https://bugs.launchpad.net/bugs/1952671
> 
> "context" is always passed as NULL so it should not be used or checked.
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/libfwtsacpica/fwts_acpica.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/src/libfwtsacpica/fwts_acpica.c b/src/libfwtsacpica/fwts_acpica.c
> index a0ef1c21..50231464 100644
> --- a/src/libfwtsacpica/fwts_acpica.c
> +++ b/src/libfwtsacpica/fwts_acpica.c
> @@ -313,9 +313,6 @@ static ACPI_STATUS fwts_region_handler(
>  			case AML_FIELD_ATTRIB_BYTES:
>  			case AML_FIELD_ATTRIB_RAW_BYTES:
>  			case AML_FIELD_ATTRIB_RAW_PROCESS_BYTES:
> -				if (!context)
> -					return AE_BAD_PARAMETER;
> -				length = context->AccessLength - 2;
>  				break;
>  			default:
>  				break;
> @@ -340,9 +337,6 @@ static ACPI_STATUS fwts_region_handler(
>  			case AML_FIELD_ATTRIB_BYTES:
>  			case AML_FIELD_ATTRIB_RAW_BYTES:
>  			case AML_FIELD_ATTRIB_RAW_PROCESS_BYTES:
> -				if (!context)
> -					return AE_BAD_PARAMETER;
> -				length = context->AccessLength - 2;
>  				break;
>  			default:
>  				break;
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Sunny Wang Jan. 17, 2022, 4:02 p.m. UTC | #2
Thanks, Alex.
Looks good to me. Reviewed-by: Sunny Wang <sunny.wang@arm.com>

We will test the fix once we get a system.

Best Regards,
Sunny
-----Original Message-----
From: fwts-devel <fwts-devel-bounces@lists.ubuntu.com> On Behalf Of ivanhu
Sent: 17 January 2022 04:05
To: fwts-devel@lists.ubuntu.com
Subject: ACK: [PATCH] fwts_acpica: skip unneccessary null check


On 1/15/22 12:14 PM, Alex Hung wrote:
> Buglink: https://bugs.launchpad.net/bugs/1952671
>
> "context" is always passed as NULL so it should not be used or checked.
>
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/libfwtsacpica/fwts_acpica.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/src/libfwtsacpica/fwts_acpica.c b/src/libfwtsacpica/fwts_acpica.c
> index a0ef1c21..50231464 100644
> --- a/src/libfwtsacpica/fwts_acpica.c
> +++ b/src/libfwtsacpica/fwts_acpica.c
> @@ -313,9 +313,6 @@ static ACPI_STATUS fwts_region_handler(
>                       case AML_FIELD_ATTRIB_BYTES:
>                       case AML_FIELD_ATTRIB_RAW_BYTES:
>                       case AML_FIELD_ATTRIB_RAW_PROCESS_BYTES:
> -                             if (!context)
> -                                     return AE_BAD_PARAMETER;
> -                             length = context->AccessLength - 2;
>                               break;
>                       default:
>                               break;
> @@ -340,9 +337,6 @@ static ACPI_STATUS fwts_region_handler(
>                       case AML_FIELD_ATTRIB_BYTES:
>                       case AML_FIELD_ATTRIB_RAW_BYTES:
>                       case AML_FIELD_ATTRIB_RAW_PROCESS_BYTES:
> -                             if (!context)
> -                                     return AE_BAD_PARAMETER;
> -                             length = context->AccessLength - 2;
>                               break;
>                       default:
>                               break;
>

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
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Sunny Wang Feb. 28, 2022, 4:21 p.m. UTC | #3
Just got a system to run FWTS with this fix. Confirmed that the issue got fixed.
Thanks again, Alex

-----Original Message-----
From: Sunny Wang <Sunny.Wang@arm.com>
Sent: 17 January 2022 16:03
To: ivanhu <ivan.hu@canonical.com>; fwts-devel@lists.ubuntu.com
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Sunny Wang <Sunny.Wang@arm.com>
Subject: RE: ACK: [PATCH] fwts_acpica: skip unneccessary null check

Thanks, Alex.
Looks good to me. Reviewed-by: Sunny Wang <sunny.wang@arm.com>

We will test the fix once we get a system.

Best Regards,
Sunny
-----Original Message-----
From: fwts-devel <fwts-devel-bounces@lists.ubuntu.com> On Behalf Of ivanhu
Sent: 17 January 2022 04:05
To: fwts-devel@lists.ubuntu.com
Subject: ACK: [PATCH] fwts_acpica: skip unneccessary null check


On 1/15/22 12:14 PM, Alex Hung wrote:
> Buglink: https://bugs.launchpad.net/bugs/1952671
>
> "context" is always passed as NULL so it should not be used or checked.
>
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/libfwtsacpica/fwts_acpica.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/src/libfwtsacpica/fwts_acpica.c b/src/libfwtsacpica/fwts_acpica.c
> index a0ef1c21..50231464 100644
> --- a/src/libfwtsacpica/fwts_acpica.c
> +++ b/src/libfwtsacpica/fwts_acpica.c
> @@ -313,9 +313,6 @@ static ACPI_STATUS fwts_region_handler(
>                       case AML_FIELD_ATTRIB_BYTES:
>                       case AML_FIELD_ATTRIB_RAW_BYTES:
>                       case AML_FIELD_ATTRIB_RAW_PROCESS_BYTES:
> -                             if (!context)
> -                                     return AE_BAD_PARAMETER;
> -                             length = context->AccessLength - 2;
>                               break;
>                       default:
>                               break;
> @@ -340,9 +337,6 @@ static ACPI_STATUS fwts_region_handler(
>                       case AML_FIELD_ATTRIB_BYTES:
>                       case AML_FIELD_ATTRIB_RAW_BYTES:
>                       case AML_FIELD_ATTRIB_RAW_PROCESS_BYTES:
> -                             if (!context)
> -                                     return AE_BAD_PARAMETER;
> -                             length = context->AccessLength - 2;
>                               break;
>                       default:
>                               break;
>

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
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
diff mbox series

Patch

diff --git a/src/libfwtsacpica/fwts_acpica.c b/src/libfwtsacpica/fwts_acpica.c
index a0ef1c21..50231464 100644
--- a/src/libfwtsacpica/fwts_acpica.c
+++ b/src/libfwtsacpica/fwts_acpica.c
@@ -313,9 +313,6 @@  static ACPI_STATUS fwts_region_handler(
 			case AML_FIELD_ATTRIB_BYTES:
 			case AML_FIELD_ATTRIB_RAW_BYTES:
 			case AML_FIELD_ATTRIB_RAW_PROCESS_BYTES:
-				if (!context)
-					return AE_BAD_PARAMETER;
-				length = context->AccessLength - 2;
 				break;
 			default:
 				break;
@@ -340,9 +337,6 @@  static ACPI_STATUS fwts_region_handler(
 			case AML_FIELD_ATTRIB_BYTES:
 			case AML_FIELD_ATTRIB_RAW_BYTES:
 			case AML_FIELD_ATTRIB_RAW_PROCESS_BYTES:
-				if (!context)
-					return AE_BAD_PARAMETER;
-				length = context->AccessLength - 2;
 				break;
 			default:
 				break;