From: Jani Nikula Date: Fri, 29 Apr 2022 14:21:40 +0000 (+0300) Subject: drm/i915: move tons of power well initializers to rodata X-Git-Tag: microblaze-v5.20~58^2~11^2~11 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=c140915c00c92e3ca2a4f8e5748f0b9ef3e5a418;p=linux-2.6-microblaze.git drm/i915: move tons of power well initializers to rodata Using compound literals for initialization can be tricky. Lacking a const qualifier, they won't end up in rodata, which is probably not expected or intended. Add const to move a whopping 136 initializers to rodata. Compare: $ objdump --syms drivers/gpu/drm/i915/display/intel_display_power_map.o | grep "\.rodata.*__compound_literal" $ objdump --syms drivers/gpu/drm/i915/display/intel_display_power_map.o | grep "\.data.*__compound_literal" Before and after the change. Fixes: c32ffce42aa5 ("drm/i915: Convert the power well descriptor domain mask to an array of domains") Fixes: 4a845ff0c0d4 ("drm/i915: Simplify power well definitions by adding power well instances") Cc: Imre Deak Cc: Jouni Högander Signed-off-by: Jani Nikula Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20220429142140.2671828-1-jani.nikula@intel.com --- diff --git a/drivers/gpu/drm/i915/display/intel_display_power_map.c b/drivers/gpu/drm/i915/display/intel_display_power_map.c index af6f54a26a35..97b367f39f35 100644 --- a/drivers/gpu/drm/i915/display/intel_display_power_map.c +++ b/drivers/gpu/drm/i915/display/intel_display_power_map.c @@ -21,7 +21,7 @@ #define I915_PW_DOMAINS(...) \ (const struct i915_power_domain_list) \ - __LIST(__LIST_INLINE_ELEMS(enum intel_display_power_domain, __VA_ARGS__)) + __LIST(__LIST_INLINE_ELEMS(const enum intel_display_power_domain, __VA_ARGS__)) #define I915_DECL_PW_DOMAINS(__name, ...) \ static const struct i915_power_domain_list __name = I915_PW_DOMAINS(__VA_ARGS__) @@ -32,7 +32,7 @@ #define I915_PW_INSTANCES(...) \ (const struct i915_power_well_instance_list) \ - __LIST(__LIST_INLINE_ELEMS(struct i915_power_well_instance, __VA_ARGS__)) + __LIST(__LIST_INLINE_ELEMS(const struct i915_power_well_instance, __VA_ARGS__)) #define I915_PW(_name, _domain_list, ...) \ { .name = _name, .domain_list = _domain_list, ## __VA_ARGS__ }