[PATCH 3/4] ACPI: sysfs: Remove some useless trailing NULL writes

From: Christophe JAILLET
Date: Mon Oct 23 2023 - 15:33:33 EST


'modalias' is only written with snprintf(), so it is already guaranteed to
be NULL terminated.

Remove the unneeded (but harmless) writes of a trailing '\0'.

Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
drivers/acpi/device_sysfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c
index 7ec3142f3eda..1cf6568a813f 100644
--- a/drivers/acpi/device_sysfs.c
+++ b/drivers/acpi/device_sysfs.c
@@ -177,7 +177,7 @@ static int create_pnp_modalias(const struct acpi_device *acpi_dev, char *modalia
len += count;
size -= count;
}
- modalias[len] = '\0';
+
return len;
}

@@ -237,7 +237,7 @@ static int create_of_modalias(const struct acpi_device *acpi_dev, char *modalias
len += count;
size -= count;
}
- modalias[len] = '\0';
+
return len;
}

--
2.32.0