Skip to contentSkip to conversation

Remove redundant assignment to ObjectType

PATCH In review Colin King 1 participant 2 messages Apr 18, 2017 – May 3, 2017 ACPI component architecture (acpica)

lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH v2 1/1 Remove redundant assignment to ObjectType

From: Colin Ian King <colin.king(a)canonical.com>

There are several occurrances of ObjectType being assigned twice successively and the first assignment is clearly unncessary and can hence be removed. Remove the redundant assignments and also a no longer needed OpInfo.

Signed-off-by Colin Ian King <colin.king(a)canonical.com>
---
 source/common/adwalk.c | 5 -----
 1 file changed, 5 deletions(-)
source/common/adwalk.c +0 -5
index 22fbfe416..73533027e 100644
@@ -747,7 +747,6 @@ AcpiDmLoadDescendingOp (
 
     WalkState = Info->WalkState;
     OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
-    ObjectType = OpInfo->ObjectType;
     ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
 
     /* Only interested in operators that create new names */
@@ -885,7 +884,6 @@ AcpiDmXrefDescendingOp (
 
     WalkState = Info->WalkState;
     OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
-    ObjectType = OpInfo->ObjectType;
     ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
 
     if ((!(OpInfo->Flags & AML_NAMED)) &&
@@ -1182,14 +1180,11 @@ AcpiDmCommonAscendingOp (
     void                    *Context)
 {
     ACPI_OP_WALK_INFO       *Info = Context;
-    const ACPI_OPCODE_INFO  *OpInfo;
     ACPI_OBJECT_TYPE        ObjectType;
 
 
     /* Close scope if necessary */
 
-    OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
-    ObjectType = OpInfo->ObjectType;
     ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
 
     if (AcpiNsOpensScope (ObjectType))
Signature · 1 line
2.11.0
author
#1 lore raw
Quoted 38 lines · Colin King

From: Colin Ian King <colin.king(a)canonical.com>

There are several occurrances of ObjectType being assigned twice successively and the first assignment is clearly unncessary and can hence be removed. Remove the redundant assignments and also a no longer needed OpInfo.

Signed-off-by Colin Ian King <colin.king(a)canonical.com>
---
 source/common/adwalk.c | 5 -----
 1 file changed, 5 deletions(-)
source/common/adwalk.c +0 -3
index 22fbfe416..73533027e 100644
@@ -747,7 +747,6 @@ AcpiDmLoadDescendingOp (
 
     WalkState = Info->WalkState;
     OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
-    ObjectType = OpInfo->ObjectType;
     ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
 
     /* Only interested in operators that create new names */
@@ -885,7 +884,6 @@ AcpiDmXrefDescendingOp (
 
     WalkState = Info->WalkState;
     OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
-    ObjectType = OpInfo->ObjectType;
     ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
 
     if ((!(OpInfo->Flags & AML_NAMED)) &&
@@ -1182,14 +1180,11 @@ AcpiDmCommonAscendingOp (
     void                    *Context)
 {
     ACPI_OP_WALK_INFO       *Info = Context;
-    const ACPI_OPCODE_INFO  *OpInfo;

source/common/adwalk.c AcpiDmCommonAscendingOp ( · line 1190

Quoted 10 lines
source/common/adwalk.c +0 -2
     ACPI_OBJECT_TYPE        ObjectType;
 
 
     /* Close scope if necessary */
 
-    OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
-    ObjectType = OpInfo->ObjectType;
     ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
 
     if (AcpiNsOpensScope (ObjectType))

Any chance this will be reviewed?