drm/nouveau/nvkm: Replace zero-length array with flexible-array member
Subsystems (3)
PATCH 1/1 drm/nouveau/nvkm: Replace zero-length array with flexible-array member
Zero-length arrays are deprecated[1] and we are moving towards adopting C99 flexible-array members instead. So, replace zero-length array declaration in struct nvfw_hs_load_header_v2 with flex-array member.
This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [2].
--- drivers/gpu/drm/nouveau/include/nvfw/hs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/include/nvfw/hs.h +1 -1
@@ -52,7 +52,7 @@ struct nvfw_hs_load_header_v2 {struct {u32 offset;u32 size; - } app[0 ]; + } app[]; };const struct nvfw_hs_load_header_v2 *nvfw_hs_load_header_v2 (struct nvkm_subdev *,const void *);
Signature · 1 line
2.34.1
Quoted 5 lines · Gustavo A. R. Silva
Zero-length arrays are deprecated[1] and we are moving towards adopting C99 flexible-array members instead. So, replace zero-length array declaration in struct
nvfw_hs_load_header_v2with flex-array member.
Quoted 8 lines
This helps with the ongoing efforts to tighten the
FORTIFY_SOURCEroutines onmemcpy()and help us make progress towards globally enabling -fstrict-flex-arrays=3 [2].
Signature · 1 line
Kees Cook
Karol Herbst
Reviewed-bywill push in a moment
Quoted 21 lines · Kees Cook
Quoted 5 lines · Gustavo A. R. Silva
Zero-length arrays are deprecated[1] and we are moving towards adopting C99 flexible-array members instead. So, replace zero-length array declaration in struct
nvfw_hs_load_header_v2with flex-array member.Quoted 8 lines
This helps with the ongoing efforts to tighten the
FORTIFY_SOURCEroutines onmemcpy()and help us make progress towards globally enabling -fstrict-flex-arrays=3 [2].Reviewed-by Kees Cook <[email protected]>--
Kees Cook