diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2025-04-22 18:44:56 +0300 |
---|---|---|
committer | Danilo Krummrich <dakr@kernel.org> | 2025-04-23 17:53:12 +0300 |
commit | b7435cf2d9b6b33bf132e0d96b14d723c610f9c3 (patch) | |
tree | 6a01f87aa79bb2456de22b51b94c7f079029a11a | |
parent | a3707f53eb3f4f3e7a30d720be0885f813d649bb (diff) | |
download | linux-b7435cf2d9b6b33bf132e0d96b14d723c610f9c3.tar.xz |
drm/nouveau: disp: Use __member_size() helper
Use __member_size() to get the size of the flex-array member at compile
time, instead of the convoluted expression `__struct_size(p) - sizeof(*p)`
Link: https://lore.kernel.org/r/aAe5eNDnRyGnxLMX@kspp
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 725331638a15..9bed728cb00e 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -776,7 +776,7 @@ nv50_hdmi_enable(struct drm_encoder *encoder, struct nouveau_crtc *nv_crtc, const u8 rekey = 56; /* binary driver, and tegra, constant */ u32 max_ac_packet; DEFINE_RAW_FLEX(struct nvif_outp_infoframe_v0, args, data, 17); - const u8 data_len = __struct_size(args) - sizeof(*args); + const u8 data_len = __member_size(args->data); int ret, size; max_ac_packet = mode->htotal - mode->hdisplay; |