[Skiboot] [PATCH v3 4/7] core/pci: pci_slot_add_loc use null-terminated strings

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Thu May 9 01:26:16 AEST 2019


On 05/08/2019 11:47 AM, Nicholas Piggin wrote:
> Use null-terminated strings consistently, making the maximum string
> length in all cases the same, and avoiding dt_add_property_nstr.
> 
> This avoids the following warning that appears after adding more
> checking to string ops:
> 
>    core/pci-slot.c: In function ‘pci_slot_add_loc’:
>    skiboot/libc/include/string.h:19:17: warning: ‘__builtin_strncpy’
>      specified bound 80 equals destination size [-Wstringop-truncation]
>     #define strncpy __builtin_strncpy
>    core/pci-slot.c:244:3: note: in expansion of macro ‘strncpy’
>       strncpy(loc_code, label, sizeof(loc_code));
>       ^~~~~~~
> 
> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>

Reviewed-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>

-Vasant



More information about the Skiboot mailing list