[Nouveau] [PATCH][next] nouveau/gsp: replace zero-length array with flex-array member and use __counted_by

Timur Tabi ttabi at nvidia.com
Thu Nov 16 19:08:47 UTC 2023


On Thu, 2023-11-16 at 12:11 -0600, Gustavo A. R. Silva wrote:
 typedef struct PACKED_REGISTRY_TABLE
 {
-    NvU32                   size;
-    NvU32                   numEntries;
-    PACKED_REGISTRY_ENTRY   entries[0];
+       NvU32                   size;
+       NvU32                   numEntries;
+       PACKED_REGISTRY_ENTRY   entries[] __counted_by(numEntries);
 } PACKED_REGISTRY_TABLE;

Well, it's better than mine: https://lore.kernel.org/all/20231107234726.854248-1-ttabi@nvidia.com/T/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20231116/fc3aa609/attachment.htm>


More information about the dri-devel mailing list