Skip to contentSkip to conversation

platform/x86: int3472/discrete: Drop unnecessary obj->type == string check

PATCH In review Hans de Goede 2 participants 3 messages Feb 4, 2023 – Feb 20, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: int3472/discrete: Drop unnecessary obj->type == string check

acpi_evaluate_dsm_typed() already verifies the type is the requested type, so this error check is a no-op, drop it.

---
 drivers/platform/x86/intel/int3472/discrete.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/platform/x86/intel/int3472/discrete.c +0 -8
index 96963e30ab6c..f064da74f50a 100644
@@ -78,14 +78,6 @@ skl_int3472_get_sensor_module_config(struct int3472_discrete_device *int3472)
 		return ERR_PTR(-ENODEV);
 	}
 
-	if (obj->string.type != ACPI_TYPE_STRING) {
-		dev_err(int3472->dev,
-			"Sensor _DSM returned a non-string value\n");
-
-		ACPI_FREE(obj);
-		return ERR_PTR(-EINVAL);
-	}
-
 	for (i = 0; i < ARRAY_SIZE(int3472_sensor_configs); i++) {
 		if (!strcmp(int3472_sensor_configs[i].sensor_module_name,
 			    obj->string.pointer))
Signature · 1 line
2.39.1
#1 lore raw

Hi,

Quoted 4 lines · Hans de Goede

acpi_evaluate_dsm_typed() already verifies the type is the requested type, so this error check is a no-op, drop it.

I've added this to my review-hans (soon to be for-next) branch now.

Regards,

Hans

Quoted 23 lines
---
 drivers/platform/x86/intel/int3472/discrete.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/platform/x86/intel/int3472/discrete.c +0 -8
index 96963e30ab6c..f064da74f50a 100644
@@ -78,14 +78,6 @@ skl_int3472_get_sensor_module_config(struct int3472_discrete_device *int3472)
 		return ERR_PTR(-ENODEV);
 	}
 
-	if (obj->string.type != ACPI_TYPE_STRING) {
-		dev_err(int3472->dev,
-			"Sensor _DSM returned a non-string value\n");
-
-		ACPI_FREE(obj);
-		return ERR_PTR(-EINVAL);
-	}
-
 	for (i = 0; i < ARRAY_SIZE(int3472_sensor_configs); i++) {
 		if (!strcmp(int3472_sensor_configs[i].sensor_module_name,
 			    obj->string.pointer))
Reviewed-by on v1 1/1
#2 lore raw
In reply to Hans de Goede
Quoted 2 lines · Hans de Goede

acpi_evaluate_dsm_typed() already verifies the type is the requested type, so this error check is a no-op, drop it.

Not sure if it's not late...

Quoted 27 lines
---
 drivers/platform/x86/intel/int3472/discrete.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/platform/x86/intel/int3472/discrete.c +0 -8
index 96963e30ab6c..f064da74f50a 100644
@@ -78,14 +78,6 @@ skl_int3472_get_sensor_module_config(struct int3472_discrete_device *int3472)
 		return ERR_PTR(-ENODEV);
 	}
 
-	if (obj->string.type != ACPI_TYPE_STRING) {
-		dev_err(int3472->dev,
-			"Sensor _DSM returned a non-string value\n");
-
-		ACPI_FREE(obj);
-		return ERR_PTR(-EINVAL);
-	}
-
 	for (i = 0; i < ARRAY_SIZE(int3472_sensor_configs); i++) {
 		if (!strcmp(int3472_sensor_configs[i].sensor_module_name,
 			    obj->string.pointer))
Signature · 1 line
2.39.1
Signature · 2 lines
With Best Regards,
Andy Shevchenko