Skip to content

Commit ae24ce5

Browse files
kvaneeshmpe
authored andcommitted
powerpc/powernv/idle: Fix build error
Fix the below build error using strlcpy instead of strncpy In function 'pnv_parse_cpuidle_dt', inlined from 'pnv_init_idle_states' at arch/powerpc/platforms/powernv/idle.c:840:7, inlined from '__machine_initcall_powernv_pnv_init_idle_states' at arch/powerpc/platforms/powernv/idle.c:870:1: arch/powerpc/platforms/powernv/idle.c:820:3: error: 'strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation] strncpy(pnv_idle_states[i].name, temp_string[i], ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PNV_IDLE_NAME_LEN); Signed-off-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 0b6aa1a commit ae24ce5

File tree

1 file changed

+1
-1
lines changed
  • arch/powerpc/platforms/powernv

1 file changed

+1
-1
lines changed

arch/powerpc/platforms/powernv/idle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ static int pnv_parse_cpuidle_dt(void)
817817
goto out;
818818
}
819819
for (i = 0; i < nr_idle_states; i++)
820-
strncpy(pnv_idle_states[i].name, temp_string[i],
820+
strlcpy(pnv_idle_states[i].name, temp_string[i],
821821
PNV_IDLE_NAME_LEN);
822822
nr_pnv_idle_states = nr_idle_states;
823823
rc = 0;

0 commit comments

Comments
 (0)