powercap: intel_rapl: Use index to initialize primitive information
authorZhang Rui <rui.zhang@intel.com>
Wed, 19 Apr 2023 02:44:10 +0000 (10:44 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 24 May 2023 16:46:19 +0000 (18:46 +0200)
commit11edbe5c66d624e2e1eec8929d3668d76a574c3b
treecc4f20251c6136364bcf5dca31f731b4da52040a
parentcb532e728ee2880be53264752e74945fd2d917ac
powercap: intel_rapl: Use index to initialize primitive information

Currently, the RAPL primitive information array is required to be
initialized in the order of enum rapl_primitives.
This can break easily, especially when different RAPL Interfaces may
support different sets of primitives.

Convert the code to initialize the primitive information using array
index explicitly.

No functional change.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Wang Wendy <wendy.wang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/powercap/intel_rapl_common.c