linux_dsm_epyc7002/drivers/gpu/drm/i915/display
Kees Cook 2713eb41a1 drm/i915: Distribute switch variables for initialization
Variables declared in a switch statement before any case statements
cannot be automatically initialized with compiler instrumentation (as
they are not part of any execution flow). With GCC's proposed automatic
stack variable initialization feature, this triggers a warning (and they
don't get initialized). Clang's automatic stack variable initialization
(via CONFIG_INIT_STACK_ALL=y) doesn't throw a warning, but it also
doesn't initialize such variables[1]. Note that these warnings (or silent
skipping) happen before the dead-store elimination optimization phase,
so even when the automatic initializations are later elided in favor of
direct initializations, the warnings remain.

To avoid these problems, move such variables into the "case" where
they're used or lift them up into the main function body.

drivers/gpu/drm/i915/display/intel_display.c: In function ‘check_digital_port_conflicts’:
drivers/gpu/drm/i915/display/intel_display.c:12963:17: warning: statement will never be executed [-Wswitch-unreachable]
12963 |    unsigned int port_mask;
      |                 ^~~~~~~~~

drivers/gpu/drm/i915/intel_pm.c: In function ‘vlv_get_fifo_size’:
drivers/gpu/drm/i915/intel_pm.c:474:7: warning: statement will never be executed [-Wswitch-unreachable]
  474 |   u32 dsparb, dsparb2, dsparb3;
      |       ^~~~~~
drivers/gpu/drm/i915/intel_pm.c: In function ‘vlv_atomic_update_fifo’:
drivers/gpu/drm/i915/intel_pm.c:1997:7: warning: statement will never be executed [-Wswitch-unreachable]
 1997 |   u32 dsparb, dsparb2, dsparb3;
      |       ^~~~~~

[1] https://bugs.llvm.org/show_bug.cgi?id=44916

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/202002201602.92CADF7D@keescook
2020-02-23 17:31:37 +02:00
..
dvo_ch7xxx.c
dvo_ch7017.c
dvo_ivch.c
dvo_ns2501.c
dvo_sil164.c
dvo_tfp410.c
icl_dsi.c drm/i915/display/icl_dsi: Make WARN* drm specific where drm_priv ptr is available 2020-02-02 14:30:23 +02:00
intel_acpi.c drm/i915/acpi: Move the code to populate ACPI device ID into intel_acpi 2020-01-24 12:58:39 +02:00
intel_acpi.h drm/i915/acpi: Move the code to populate ACPI device ID into intel_acpi 2020-01-24 12:58:39 +02:00
intel_atomic_plane.c drm/i915/display: Fix NULL-crtc deref in calc_min_cdclk() 2020-02-04 09:38:11 +00:00
intel_atomic_plane.h drm/i915: Convert cdclk to global state 2020-01-31 17:00:44 +02:00
intel_atomic.c drm/i915/atomic: conversion to drm_device based logging macros. 2020-02-11 15:11:50 +02:00
intel_atomic.h drm/i915: Introduce better global state handling 2020-01-31 17:00:44 +02:00
intel_audio.c drm/i915/audio: Skip the cdclk modeset if no pipes attached 2020-02-04 09:38:11 +00:00
intel_audio.h
intel_bios.c drm/i915/display: Make WARN* drm specific where drm_device ptr is available 2020-02-04 11:00:04 +02:00
intel_bios.h drm/i915/bios: add intel_bios_port_supports_*() 2020-01-21 10:51:44 +02:00
intel_bw.c drm/i915/display: Make WARN* drm specific where drm_device ptr is available 2020-02-04 11:00:04 +02:00
intel_bw.h drm/i915: Convert bandwidth state to global state 2020-01-31 17:00:44 +02:00
intel_cdclk.c drm/i915: Read rawclk_freq earlier 2020-02-19 14:09:18 +00:00
intel_cdclk.h drm/i915: Read rawclk_freq earlier 2020-02-19 14:09:18 +00:00
intel_color.c drm/i915: Add i9xx_lut_8() 2020-02-20 21:44:54 +02:00
intel_color.h
intel_combo_phy.c drm/i915/combo_phy: convert to struct drm_device logging macros. 2020-02-11 15:23:33 +02:00
intel_combo_phy.h
intel_connector.c drm/i915/display: Make WARN* drm specific where drm_device ptr is available 2020-02-04 11:00:04 +02:00
intel_connector.h
intel_crt.c drm/i915: Mark all HPD capabled connectors as such 2020-02-20 21:48:40 +02:00
intel_crt.h
intel_csr.c drm/i915/csr: use intel_de_*() functions for register access 2020-02-18 10:43:32 +02:00
intel_csr.h drm/i915: move intel_csr.[ch] under display/ 2020-02-14 08:48:12 +02:00
intel_ddi.c drm/i915/dp: Compute port sync crtc states post compute_config() 2020-02-20 13:53:55 +05:30
intel_ddi.h
intel_de.h drm/i915: add display engine uncore helpers 2020-01-23 11:07:00 +02:00
intel_display_debugfs.c drm/i915/display: use intel_de_*() functions for register access 2020-02-18 10:43:40 +02:00
intel_display_debugfs.h drm/i915: split out display debugfs to a separate file 2020-02-14 13:26:51 +02:00
intel_display_power.c drm/i915/tgl: Add Wa_22010178259:tgl 2020-02-21 14:55:47 -08:00
intel_display_power.h drm/i915: Introduce parameterized DBUF_CTL 2020-02-05 19:16:57 +02:00
intel_display_types.h drm/i915: Introduce encoder->compute_config_late() 2020-02-20 13:53:55 +05:30
intel_display.c drm/i915: Distribute switch variables for initialization 2020-02-23 17:31:37 +02:00
intel_display.h drm/i915: split intel_modeset_driver_remove() to pre/post irq uninstall 2020-02-19 15:16:27 +02:00
intel_dp_aux_backlight.c Revert "drm/i915: Don't use VBT for detecting DPCD backlight controls" 2020-02-07 13:06:54 +02:00
intel_dp_aux_backlight.h
intel_dp_link_training.c drm/i915/dp_link_training: convert to drm_device based logging macros. 2020-02-11 15:11:34 +02:00
intel_dp_link_training.h
intel_dp_mst.c drm/i915/mst: Set intel_dp_set_m_n() for MST slaves 2020-02-15 11:05:56 +02:00
intel_dp_mst.h
intel_dp.c drm/i915: Mark all HPD capabled connectors as such 2020-02-20 21:48:40 +02:00
intel_dp.h
intel_dpio_phy.c drm/i915/dpio_phy: convert to drm_device based logging macros. 2020-02-11 15:28:52 +02:00
intel_dpio_phy.h
intel_dpll_mgr.c drm/i915/dpll_mgr: convert to drm_device based logging macros. 2020-02-11 15:23:28 +02:00
intel_dpll_mgr.h
intel_dsb.c drm/i915/display: Make WARN* drm specific where drm_device ptr is available 2020-02-04 11:00:04 +02:00
intel_dsb.h
intel_dsi_dcs_backlight.c drm/i915/display: Make WARN* drm specific where drm_device ptr is available 2020-02-04 11:00:04 +02:00
intel_dsi_dcs_backlight.h
intel_dsi_vbt.c drm/i915/dsi_vbt: convert to drm_device based logging macros. 2020-02-11 15:23:52 +02:00
intel_dsi.c
intel_dsi.h drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_dvo_dev.h
intel_dvo.c drm/i915/dvo: Mark TMDS DVO connectors as polled 2020-02-04 23:32:52 +02:00
intel_dvo.h
intel_fbc.c drm/i915/display/fbc: Make WARN* drm specific where drm_priv ptr is available 2020-02-04 10:46:49 +02:00
intel_fbc.h drm/i915/fbc: Move the plane state check into the fbc functions 2020-01-15 17:16:32 +02:00
intel_fbdev.c drm/i915/fbdev: Make WARN* drm specific where drm_device ptr is available 2020-02-04 10:46:56 +02:00
intel_fbdev.h
intel_fifo_underrun.c drm/i915/fifo_underrun: use intel_de_*() functions for register access 2020-01-27 16:38:33 +02:00
intel_fifo_underrun.h
intel_frontbuffer.c
intel_frontbuffer.h
intel_global_state.c drm/i915: Introduce better global state handling 2020-01-31 17:00:44 +02:00
intel_global_state.h drm/i915: Introduce better global state handling 2020-01-31 17:00:44 +02:00
intel_gmbus.c drm/i915/display: Make WARN* drm specific where drm_device ptr is available 2020-02-04 11:00:04 +02:00
intel_gmbus.h
intel_hdcp.c drm/i915: HDCP support on above PORT_E 2020-02-11 11:17:20 +02:00
intel_hdcp.h drm/i915/hdcp: move update pipe code to hdcp 2020-02-05 11:08:28 +02:00
intel_hdmi.c drm/i915: Mark all HPD capabled connectors as such 2020-02-20 21:48:40 +02:00
intel_hdmi.h drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_hotplug.c drm/i915: Mark all HPD capabled connectors as such 2020-02-20 21:48:40 +02:00
intel_hotplug.h
intel_lpe_audio.c drm/i915/display: Make WARN* drm specific where drm_device ptr is available 2020-02-04 11:00:04 +02:00
intel_lpe_audio.h
intel_lspcon.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_lspcon.h
intel_lvds.c drm/i915/display: Make WARN* drm specific where drm_device ptr is available 2020-02-04 11:00:04 +02:00
intel_lvds.h
intel_opregion.c drm/i915/display: Make WARN* drm specific where drm_device ptr is available 2020-02-04 11:00:04 +02:00
intel_opregion.h
intel_overlay.c drm/i915/display/overlay: Make WARN* drm specific where drm_priv ptr is available 2020-02-04 10:53:06 +02:00
intel_overlay.h
intel_panel.c drm/i915: Parametrize PFIT_PIPE 2020-02-20 21:50:38 +02:00
intel_panel.h
intel_pipe_crc.c drm/i915/pipe_crc: automatic conversion to drm_device based logging macros. 2020-02-04 11:13:45 +02:00
intel_pipe_crc.h
intel_psr.c drm/i915/dc3co: Add description of how it works 2020-02-10 09:15:54 -08:00
intel_psr.h drm/i915/display: Force the state compute phase once to enable PSR 2020-01-08 08:12:01 -08:00
intel_quirks.c drm/i915/quirks: automatic conversion to drm_device based logging macros. 2020-02-04 11:13:39 +02:00
intel_quirks.h
intel_sdvo_regs.h
intel_sdvo.c drm/i915: Mark all HPD capabled connectors as such 2020-02-20 21:48:40 +02:00
intel_sdvo.h
intel_sprite.c drm/i915/sprite: automatic conversion to drm_device based logging macros 2020-02-04 11:13:33 +02:00
intel_sprite.h
intel_tc.c drm/i915/tc: automatic conversion to drm_device based logging macros. 2020-02-04 11:13:31 +02:00
intel_tc.h
intel_tv.c drm/i915/tv: automatic conversion to drm_device based logging macros. 2020-02-04 11:13:26 +02:00
intel_tv.h
intel_vbt_defs.h drm/i915/vbt: Rename BDB_LVDS_POWER to BDB_LFP_POWER 2020-01-14 12:38:59 -08:00
intel_vdsc.c drm/i915/vdsc: convert to struct drm_device based logging macros. 2020-02-04 11:13:23 +02:00
intel_vdsc.h
intel_vga.c drm/i915/vga: conversion to drm_device based logging macros. 2020-02-04 11:13:20 +02:00
intel_vga.h
vlv_dsi_pll.c drm/i915/vlv_dsi_pll: conversion to struct drm_device logging macros. 2020-02-04 11:13:15 +02:00
vlv_dsi.c drm/i915/vlv_dsi: conversion to drm_device based logging macros. 2020-02-04 11:13:18 +02:00