drm/nouveau: nouveau: use correct string length
gcc-8 reports drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c: In function 'nvkm_perfmon_mthd': include/linux/string.h:265:9: error: '__builtin_strncpy' specified bound 64 equals destination size [-Werror=stringop-truncation] We need one less byte or call strlcpy() to make it a nul-terminated string. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
94ee54dc80
commit
ee0d581002
|
@ -462,7 +462,7 @@ nvkm_perfmon_mthd_query_domain(struct nvkm_perfmon *perfmon,
|
|||
|
||||
args->v0.id = di;
|
||||
args->v0.signal_nr = nvkm_perfdom_count_perfsig(dom);
|
||||
strncpy(args->v0.name, dom->name, sizeof(args->v0.name));
|
||||
strncpy(args->v0.name, dom->name, sizeof(args->v0.name) - 1);
|
||||
|
||||
/* Currently only global counters (PCOUNTER) are implemented
|
||||
* but this will be different for local counters (MP). */
|
||||
|
@ -514,7 +514,7 @@ nvkm_perfmon_mthd_query_signal(struct nvkm_perfmon *perfmon,
|
|||
"/%s/%02x", dom->name, si);
|
||||
} else {
|
||||
strncpy(args->v0.name, sig->name,
|
||||
sizeof(args->v0.name));
|
||||
sizeof(args->v0.name) - 1);
|
||||
}
|
||||
|
||||
args->v0.signal = si;
|
||||
|
@ -572,7 +572,7 @@ nvkm_perfmon_mthd_query_source(struct nvkm_perfmon *perfmon,
|
|||
|
||||
args->v0.source = sig->source[si];
|
||||
args->v0.mask = src->mask;
|
||||
strncpy(args->v0.name, src->name, sizeof(args->v0.name));
|
||||
strncpy(args->v0.name, src->name, sizeof(args->v0.name) - 1);
|
||||
}
|
||||
|
||||
if (++si < source_nr) {
|
||||
|
|
Loading…
Reference in New Issue