Commit d1f66f05 authored by Tian Tao's avatar Tian Tao Committed by Gerd Hoffmann

drm/qxl: use flexible-array member instead of zero-length array

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: default avatarTian Tao <tiantao6@hisilicon.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1607650349-28513-1-git-send-email-tiantao6@hisilicon.comSigned-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 2077ec34
...@@ -271,7 +271,7 @@ struct qxl_mode { ...@@ -271,7 +271,7 @@ struct qxl_mode {
/* qxl-1 compat: fixed */ /* qxl-1 compat: fixed */
struct qxl_modes { struct qxl_modes {
uint32_t n_modes; uint32_t n_modes;
struct qxl_mode modes[0]; struct qxl_mode modes[];
}; };
/* qxl-1 compat: append only */ /* qxl-1 compat: append only */
...@@ -382,12 +382,12 @@ struct qxl_data_chunk { ...@@ -382,12 +382,12 @@ struct qxl_data_chunk {
uint32_t data_size; uint32_t data_size;
QXLPHYSICAL prev_chunk; QXLPHYSICAL prev_chunk;
QXLPHYSICAL next_chunk; QXLPHYSICAL next_chunk;
uint8_t data[0]; uint8_t data[];
}; };
struct qxl_message { struct qxl_message {
union qxl_release_info release_info; union qxl_release_info release_info;
uint8_t data[0]; uint8_t data[];
}; };
struct qxl_compat_update_cmd { struct qxl_compat_update_cmd {
...@@ -469,7 +469,7 @@ struct qxl_raster_glyph { ...@@ -469,7 +469,7 @@ struct qxl_raster_glyph {
struct qxl_point glyph_origin; struct qxl_point glyph_origin;
uint16_t width; uint16_t width;
uint16_t height; uint16_t height;
uint8_t data[0]; uint8_t data[];
}; };
struct qxl_string { struct qxl_string {
...@@ -768,7 +768,7 @@ enum { ...@@ -768,7 +768,7 @@ enum {
struct qxl_path_seg { struct qxl_path_seg {
uint32_t flags; uint32_t flags;
uint32_t count; uint32_t count;
struct qxl_point_fix points[0]; struct qxl_point_fix points[];
}; };
struct qxl_path { struct qxl_path {
...@@ -819,7 +819,7 @@ struct qxl_image_descriptor { ...@@ -819,7 +819,7 @@ struct qxl_image_descriptor {
struct qxl_palette { struct qxl_palette {
uint64_t unique; uint64_t unique;
uint16_t num_ents; uint16_t num_ents;
uint32_t ents[0]; uint32_t ents[];
}; };
struct qxl_bitmap { struct qxl_bitmap {
...@@ -838,7 +838,7 @@ struct qxl_surface_id { ...@@ -838,7 +838,7 @@ struct qxl_surface_id {
struct qxl_encoder_data { struct qxl_encoder_data {
uint32_t data_size; uint32_t data_size;
uint8_t data[0]; uint8_t data[];
}; };
struct qxl_image { struct qxl_image {
...@@ -868,7 +868,7 @@ struct qxl_monitors_config { ...@@ -868,7 +868,7 @@ struct qxl_monitors_config {
uint16_t count; uint16_t count;
uint16_t max_allowed; /* If it is 0 no fixed limit is given by the uint16_t max_allowed; /* If it is 0 no fixed limit is given by the
driver */ driver */
struct qxl_head heads[0]; struct qxl_head heads[];
}; };
#pragma pack(pop) #pragma pack(pop)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment