drm/qxl: use flexible-array member instead of zero-length array
authorTian Tao <tiantao6@hisilicon.com>
Fri, 11 Dec 2020 01:32:29 +0000 (09:32 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 22 Dec 2020 12:43:29 +0000 (13:43 +0100)
Use flexible-array member introduced in C99 instead of zero-length
array. Most of zero-length array was already taken care in previous
patch [1]. Now modified few more cases which were not handled earlier.

[1]. https://patchwork.kernel.org/patch/11394197/

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1607650349-28513-1-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
drivers/gpu/drm/qxl/qxl_dev.h

index a7bc31f..06caa61 100644 (file)
@@ -271,7 +271,7 @@ struct qxl_mode {
 /* qxl-1 compat: fixed */
 struct qxl_modes {
        uint32_t n_modes;
-       struct qxl_mode modes[0];
+       struct qxl_mode modes[];
 };
 
 /* qxl-1 compat: append only */
@@ -382,12 +382,12 @@ struct qxl_data_chunk {
        uint32_t data_size;
        QXLPHYSICAL prev_chunk;
        QXLPHYSICAL next_chunk;
-       uint8_t data[0];
+       uint8_t data[];
 };
 
 struct qxl_message {
        union qxl_release_info release_info;
-       uint8_t data[0];
+       uint8_t data[];
 };
 
 struct qxl_compat_update_cmd {
@@ -469,7 +469,7 @@ struct qxl_raster_glyph {
        struct qxl_point glyph_origin;
        uint16_t width;
        uint16_t height;
-       uint8_t data[0];
+       uint8_t data[];
 };
 
 struct qxl_string {
@@ -768,7 +768,7 @@ enum {
 struct qxl_path_seg {
        uint32_t flags;
        uint32_t count;
-       struct qxl_point_fix points[0];
+       struct qxl_point_fix points[];
 };
 
 struct qxl_path {
@@ -819,7 +819,7 @@ struct qxl_image_descriptor {
 struct qxl_palette {
        uint64_t unique;
        uint16_t num_ents;
-       uint32_t ents[0];
+       uint32_t ents[];
 };
 
 struct qxl_bitmap {
@@ -838,7 +838,7 @@ struct qxl_surface_id {
 
 struct qxl_encoder_data {
        uint32_t data_size;
-       uint8_t data[0];
+       uint8_t data[];
 };
 
 struct qxl_image {
@@ -868,7 +868,7 @@ struct qxl_monitors_config {
        uint16_t count;
        uint16_t max_allowed; /* If it is 0 no fixed limit is given by the
                                 driver */
-       struct qxl_head heads[0];
+       struct qxl_head heads[];
 };
 
 #pragma pack(pop)