search for: stack_flex_count

Displaying 3 results from an estimated 3 matches for "stack_flex_count".

2024 Oct 03
2
[PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning
...gt;> Usually, that's me. But I thought you might want to send a v2 based on Kees' >> comments? > > Do you plan to follow up on this? I'd prefer if we could get rid of the open- > coded "17". So, maybe just go with the define until we have something like > STACK_FLEX_COUNT()? Do you mean the following define...? nv50_hdmi_enable(...) { ... #define data_len 17 DEFINE_RAW_FLEX(struct nvif_outp_infoframe_v0, args, data, data_len); ...rest of function... #undef data_len } Thanks -- Gustavo
2024 Aug 22
1
[PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning
...tp_infoframe_v0, args, data, data_len); ...rest of function... #undef data_len } or an ungainly but compile-time calculated value that exposes some DEFINE_FLEX internals: const u8 data_len = (sizeof(args_u) - sizeof(*args)) / sizeof(*args->data); (Maybe a helper is needed for that?) #define STACK_FLEX_COUNT(name, member) \ ((sizeof(name##_u) = sizeof(*(name))) / sizeof(*(name)->member)) > @@ -815,29 +813,29 @@ nv50_hdmi_enable(struct drm_encoder *encoder, struct nouveau_crtc *nv_crtc, > return; > > /* AVI InfoFrame. */ > - args.infoframe.version = 0; > - args.infoframe.he...
2024 Aug 21
2
[PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning
Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known at compile-time, and refactor the rest of the code, accordingly. So, with this, fix the following warning: drivers/gpu/drm/nouveau/dispnv50/disp.c:779:47: warning: structure containing a flexible array member is not at the end of another structure