ACPI: move from strlcpy() with unused retval to strscpy()
[linux-2.6-block.git] / drivers / acpi / processor_idle.c
index 16a1663d02d460579e61c9e98ff2d1ca5d0ba0c8..1778016ea89517ab5042fdd5663f7784fddfb37e 100644 (file)
@@ -787,7 +787,7 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr)
 
                state = &drv->states[count];
                snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i);
-               strlcpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
+               strscpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
                state->exit_latency = cx->latency;
                state->target_residency = cx->latency * latency_factor;
                state->enter = acpi_idle_enter;
@@ -956,7 +956,7 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle,
 
                obj = pkg_elem + 9;
                if (obj->type == ACPI_TYPE_STRING)
-                       strlcpy(lpi_state->desc, obj->string.pointer,
+                       strscpy(lpi_state->desc, obj->string.pointer,
                                ACPI_CX_DESC_LEN);
 
                lpi_state->index = state_idx;
@@ -1022,7 +1022,7 @@ static bool combine_lpi_states(struct acpi_lpi_state *local,
        result->arch_flags = parent->arch_flags;
        result->index = parent->index;
 
-       strlcpy(result->desc, local->desc, ACPI_CX_DESC_LEN);
+       strscpy(result->desc, local->desc, ACPI_CX_DESC_LEN);
        strlcat(result->desc, "+", ACPI_CX_DESC_LEN);
        strlcat(result->desc, parent->desc, ACPI_CX_DESC_LEN);
        return true;
@@ -1196,7 +1196,7 @@ static int acpi_processor_setup_lpi_states(struct acpi_processor *pr)
 
                state = &drv->states[i];
                snprintf(state->name, CPUIDLE_NAME_LEN, "LPI-%d", i);
-               strlcpy(state->desc, lpi->desc, CPUIDLE_DESC_LEN);
+               strscpy(state->desc, lpi->desc, CPUIDLE_DESC_LEN);
                state->exit_latency = lpi->wake_latency;
                state->target_residency = lpi->min_residency;
                if (lpi->arch_flags)