lkml.org 
[lkml]   [2023]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4/4] ACPI: sysfs: Remove some dead code
    Date
    snprintf() never returns <0 values.
    So remove some dead code.

    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    ---
    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
    \
     
     \ /
      Last update: 2023-10-23 21:34    [W:5.869 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site