Skip to content

Commit eebc152

Browse files
committed
drm/i915/display: Clean up zero initializers
Just use a simple {} to zero initialize arrays/structs instead of the hodgepodge of stuff we are using currently. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
1 parent 02c8d56 commit eebc152

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

drivers/gpu/drm/i915/display/intel_acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static acpi_handle intel_dsm_pci_probe(struct pci_dev *pdev)
153153
static bool intel_dsm_detect(void)
154154
{
155155
acpi_handle dhandle = NULL;
156-
char acpi_method_name[255] = { 0 };
156+
char acpi_method_name[255] = {};
157157
struct acpi_buffer buffer = {sizeof(acpi_method_name), acpi_method_name};
158158
struct pci_dev *pdev = NULL;
159159
int vga_count = 0;

drivers/gpu/drm/i915/display/intel_cx0_phy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3009,7 +3009,7 @@ void intel_c10pll_state_verify(struct intel_atomic_state *state,
30093009
struct drm_i915_private *i915 = to_i915(state->base.dev);
30103010
const struct intel_crtc_state *new_crtc_state =
30113011
intel_atomic_get_new_crtc_state(state, crtc);
3012-
struct intel_c10pll_state mpllb_hw_state = { 0 };
3012+
struct intel_c10pll_state mpllb_hw_state = {};
30133013
const struct intel_c10pll_state *mpllb_sw_state = &new_crtc_state->cx0pll_state.c10;
30143014
struct intel_encoder *encoder;
30153015
enum phy phy;

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@ int intel_dp_dsc_compute_max_bpp(const struct intel_connector *connector,
15831583
{
15841584
struct drm_i915_private *i915 = to_i915(connector->base.dev);
15851585
int i, num_bpc;
1586-
u8 dsc_bpc[3] = {0};
1586+
u8 dsc_bpc[3] = {};
15871587
u8 dsc_max_bpc;
15881588

15891589
dsc_max_bpc = intel_dp_dsc_max_src_input_bpc(i915);
@@ -2006,7 +2006,7 @@ static int intel_dp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
20062006
u8 max_req_bpc = conn_state->max_requested_bpc;
20072007
u8 dsc_max_bpc, dsc_max_bpp;
20082008
u8 dsc_min_bpc, dsc_min_bpp;
2009-
u8 dsc_bpc[3] = {0};
2009+
u8 dsc_bpc[3] = {};
20102010
int forced_bpp, pipe_bpp;
20112011
int num_bpc, i, ret;
20122012

@@ -2940,7 +2940,7 @@ intel_edp_init_source_oui(struct intel_dp *intel_dp, bool careful)
29402940
{
29412941
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
29422942
u8 oui[] = { 0x00, 0xaa, 0x01 };
2943-
u8 buf[3] = { 0 };
2943+
u8 buf[3] = {};
29442944

29452945
/*
29462946
* During driver init, we want to be careful and avoid changing the source OUI if it's

drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ intel_dp_aux_hdr_get_backlight(struct intel_connector *connector, enum pipe pipe
169169
struct intel_panel *panel = &connector->panel;
170170
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
171171
u8 tmp;
172-
u8 buf[2] = { 0 };
172+
u8 buf[2] = {};
173173

174174
if (drm_dp_dpcd_readb(&intel_dp->aux, INTEL_EDP_HDR_GETSET_CTRL_PARAMS, &tmp) != 1) {
175175
drm_err(&i915->drm, "[CONNECTOR:%d:%s] Failed to read current backlight mode from DPCD\n",
@@ -204,7 +204,7 @@ intel_dp_aux_hdr_set_aux_backlight(const struct drm_connector_state *conn_state,
204204
struct intel_connector *connector = to_intel_connector(conn_state->connector);
205205
struct drm_device *dev = connector->base.dev;
206206
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
207-
u8 buf[4] = { 0 };
207+
u8 buf[4] = {};
208208

209209
buf[0] = level & 0xFF;
210210
buf[1] = (level & 0xFF00) >> 8;

drivers/gpu/drm/i915/display/intel_dp_mst.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static int intel_dp_dsc_mst_compute_link_config(struct intel_encoder *encoder,
192192
&crtc_state->hw.adjusted_mode;
193193
int slots = -EINVAL;
194194
int i, num_bpc;
195-
u8 dsc_bpc[3] = {0};
195+
u8 dsc_bpc[3] = {};
196196
int min_bpp, max_bpp, sink_min_bpp, sink_max_bpp;
197197
u8 dsc_max_bpc;
198198
bool need_timeslot_recalc = false;

drivers/gpu/drm/i915/display/intel_gmbus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ int intel_gmbus_output_aksv(struct i2c_adapter *adapter)
781781
struct intel_gmbus *bus = to_intel_gmbus(adapter);
782782
struct drm_i915_private *i915 = bus->i915;
783783
u8 cmd = DRM_HDCP_DDC_AKSV;
784-
u8 buf[DRM_HDCP_KSV_LEN] = { 0 };
784+
u8 buf[DRM_HDCP_KSV_LEN] = {};
785785
struct i2c_msg msgs[] = {
786786
{
787787
.addr = DRM_HDCP_DDC_ADDR,

drivers/gpu/drm/i915/display/intel_plane_initial.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
166166
{
167167
struct drm_device *dev = crtc->base.dev;
168168
struct drm_i915_private *dev_priv = to_i915(dev);
169-
struct drm_mode_fb_cmd2 mode_cmd = { 0 };
169+
struct drm_mode_fb_cmd2 mode_cmd = {};
170170
struct drm_framebuffer *fb = &plane_config->fb->base;
171171
struct i915_vma *vma;
172172

drivers/gpu/drm/i915/display/intel_sdvo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ intel_sdvo_get_value(struct intel_sdvo *intel_sdvo, u8 cmd, void *value, int len
649649

650650
static bool intel_sdvo_set_target_input(struct intel_sdvo *intel_sdvo)
651651
{
652-
struct intel_sdvo_set_target_input_args targets = {0};
652+
struct intel_sdvo_set_target_input_args targets = {};
653653
return intel_sdvo_set_value(intel_sdvo,
654654
SDVO_CMD_SET_TARGET_INPUT,
655655
&targets, sizeof(targets));

drivers/gpu/drm/i915/display/intel_snps_phy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1998,7 +1998,7 @@ void intel_mpllb_state_verify(struct intel_atomic_state *state,
19981998
struct drm_i915_private *i915 = to_i915(state->base.dev);
19991999
const struct intel_crtc_state *new_crtc_state =
20002000
intel_atomic_get_new_crtc_state(state, crtc);
2001-
struct intel_mpllb_state mpllb_hw_state = { 0 };
2001+
struct intel_mpllb_state mpllb_hw_state = {};
20022002
const struct intel_mpllb_state *mpllb_sw_state = &new_crtc_state->mpllb_state;
20032003
struct intel_encoder *encoder;
20042004

drivers/gpu/drm/i915/display/intel_wm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static ssize_t wm_latency_write(struct file *file, const char __user *ubuf,
290290
{
291291
struct seq_file *m = file->private_data;
292292
struct drm_i915_private *dev_priv = m->private;
293-
u16 new[8] = { 0 };
293+
u16 new[8] = {};
294294
int level;
295295
int ret;
296296
char tmp[32];

0 commit comments

Comments
 (0)