diff mbox series

i915: make array flex_regs static const

Message ID 20220109203152.51414-1-colin.i.king@gmail.com (mailing list archive)
State New, archived
Headers show
Series i915: make array flex_regs static const | expand

Commit Message

Colin Ian King Jan. 9, 2022, 8:31 p.m. UTC
Don't populate the read-only array flex_regs on the stack but
instead it static const. Also makes the object code a little smaller.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/gpu/drm/i915/i915_perf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tvrtko Ursulin Jan. 11, 2022, 9:13 a.m. UTC | #1
On 09/01/2022 20:31, Colin Ian King wrote:
> Don't populate the read-only array flex_regs on the stack but
> instead it static const. Also makes the object code a little smaller.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>   drivers/gpu/drm/i915/i915_perf.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> index e27f3b7cf094..df698960fdc0 100644
> --- a/drivers/gpu/drm/i915/i915_perf.c
> +++ b/drivers/gpu/drm/i915/i915_perf.c
> @@ -2114,7 +2114,7 @@ gen8_update_reg_state_unlocked(const struct intel_context *ce,
>   	u32 ctx_oactxctrl = stream->perf->ctx_oactxctrl_offset;
>   	u32 ctx_flexeu0 = stream->perf->ctx_flexeu0_offset;
>   	/* The MMIO offsets for Flex EU registers aren't contiguous */
> -	i915_reg_t flex_regs[] = {
> +	static const i915_reg_t flex_regs[] = {
>   		EU_PERF_CNTL0,
>   		EU_PERF_CNTL1,
>   		EU_PERF_CNTL2,
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

And will merge shortly, thanks for the patch.

Regards,

Tvrtko
Tvrtko Ursulin Jan. 11, 2022, 10:26 a.m. UTC | #2
On 11/01/2022 09:13, Tvrtko Ursulin wrote:
> On 09/01/2022 20:31, Colin Ian King wrote:
>> Don't populate the read-only array flex_regs on the stack but
>> instead it static const. Also makes the object code a little smaller.
>>
>> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
>> ---
>>   drivers/gpu/drm/i915/i915_perf.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_perf.c 
>> b/drivers/gpu/drm/i915/i915_perf.c
>> index e27f3b7cf094..df698960fdc0 100644
>> --- a/drivers/gpu/drm/i915/i915_perf.c
>> +++ b/drivers/gpu/drm/i915/i915_perf.c
>> @@ -2114,7 +2114,7 @@ gen8_update_reg_state_unlocked(const struct 
>> intel_context *ce,
>>       u32 ctx_oactxctrl = stream->perf->ctx_oactxctrl_offset;
>>       u32 ctx_flexeu0 = stream->perf->ctx_flexeu0_offset;
>>       /* The MMIO offsets for Flex EU registers aren't contiguous */
>> -    i915_reg_t flex_regs[] = {
>> +    static const i915_reg_t flex_regs[] = {
>>           EU_PERF_CNTL0,
>>           EU_PERF_CNTL1,
>>           EU_PERF_CNTL2,
>>
> 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> And will merge shortly, thanks for the patch.

Actually I couldn't merge it because you have a Author and Signed-off-by 
mismatch due your entry in .mailmap. Is this something you can update or 
send the patch from an address which matches it?

Regards,

Tvrtko
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index e27f3b7cf094..df698960fdc0 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -2114,7 +2114,7 @@  gen8_update_reg_state_unlocked(const struct intel_context *ce,
 	u32 ctx_oactxctrl = stream->perf->ctx_oactxctrl_offset;
 	u32 ctx_flexeu0 = stream->perf->ctx_flexeu0_offset;
 	/* The MMIO offsets for Flex EU registers aren't contiguous */
-	i915_reg_t flex_regs[] = {
+	static const i915_reg_t flex_regs[] = {
 		EU_PERF_CNTL0,
 		EU_PERF_CNTL1,
 		EU_PERF_CNTL2,