mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
drm/i915/display: Make POWER_DOMAIN_*() always result in enum intel_display_power_domain
In the hope of contributing to type safety in our code, let's ensure that the type returned by the POWER_DOMAIN_*() macros is always of type enum intel_display_power_domain. v2: - Remove accidental +1 in definition of POWER_DOMAIN_PIPE(). (Jani) Cc: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250227-improve-type-safey-power-domain-macros-v3-2-b6eaa00f9c33@intel.com Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
This commit is contained in:
parent
322ec93e90
commit
5c91b5ad71
|
|
@ -117,12 +117,13 @@ enum intel_display_power_domain {
|
|||
POWER_DOMAIN_INVALID = POWER_DOMAIN_NUM,
|
||||
};
|
||||
|
||||
#define POWER_DOMAIN_PIPE(pipe) ((pipe) - PIPE_A + POWER_DOMAIN_PIPE_A)
|
||||
#define POWER_DOMAIN_PIPE(pipe) \
|
||||
((enum intel_display_power_domain)((pipe) - PIPE_A + POWER_DOMAIN_PIPE_A))
|
||||
#define POWER_DOMAIN_PIPE_PANEL_FITTER(pipe) \
|
||||
((pipe) - PIPE_A + POWER_DOMAIN_PIPE_PANEL_FITTER_A)
|
||||
((enum intel_display_power_domain)((pipe) - PIPE_A + POWER_DOMAIN_PIPE_PANEL_FITTER_A))
|
||||
#define POWER_DOMAIN_TRANSCODER(tran) \
|
||||
((tran) == TRANSCODER_EDP ? POWER_DOMAIN_TRANSCODER_EDP : \
|
||||
(tran) - TRANSCODER_A + POWER_DOMAIN_TRANSCODER_A)
|
||||
(enum intel_display_power_domain)((tran) - TRANSCODER_A + POWER_DOMAIN_TRANSCODER_A))
|
||||
|
||||
struct intel_power_domain_mask {
|
||||
DECLARE_BITMAP(bits, POWER_DOMAIN_NUM);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user