gpu: nvgpu: POSIX does not have a strlcpy

So don't use it in common code. This could be implemented in
common code but it would just be a wrapper around strncpy()
most likely since we aren't going to maintain low level
(possibly asm) implementations of APIs.

NVGPU-525

Signed-off-by: Alex Waterman <alexw@nvidia.com>
Change-Id: If446589cd1736456184daa75ae539c4ce332b741
Reviewed-on: https://git-master.nvidia.com/r/1658300
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Alex Waterman
2018-02-15 12:47:13 -08:00
committed by mobile promotions
parent 2780ae27fa
commit 98e87ca10c

View File

@@ -156,7 +156,8 @@ int __nvgpu_alloc_common_init(struct nvgpu_allocator *a, struct gk20a *g,
a->priv = priv;
a->debug = dbg;
strlcpy(a->name, name, sizeof(a->name));
strncpy(a->name, name, sizeof(a->name));
a->name[sizeof(a->name) - 1] = 0;
return 0;
}