Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core/pci: pci_slot_add_loc use null-terminated strings
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@gmail.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
- Loading branch information