[PATCH 4/4] ACPI: sysfs: Remove some dead code
From: Christophe JAILLET
Date: Mon Oct 23 2023 - 15:33:35 EST
snprintf() never returns <0 values.
So remove some dead code.
Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
drivers/acpi/device_sysfs.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c
index 1cf6568a813f..23373faa35ec 100644
--- a/drivers/acpi/device_sysfs.c
+++ b/drivers/acpi/device_sysfs.c
@@ -168,8 +168,6 @@ static int create_pnp_modalias(const struct acpi_device *acpi_dev, char *modalia
continue;
count = snprintf(&modalias[len], size, "%s:", id->id);
- if (count < 0)
- return -EINVAL;
if (count >= size)
return -ENOMEM;
@@ -228,8 +226,6 @@ static int create_of_modalias(const struct acpi_device *acpi_dev, char *modalias
for (i = 0; i < nval; i++, obj++) {
count = snprintf(&modalias[len], size, "C%s",
obj->string.pointer);
- if (count < 0)
- return -EINVAL;
if (count >= size)
return -ENOMEM;
--
2.32.0