diff options
author | Zhao Wei Liew <zhaoweiliew@gmail.com> | 2016-06-26 11:37:59 +0800 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-10-23 01:12:56 +0300 |
commit | ee9bd619746cb0425905baf354e7f52130bb2ef8 (patch) | |
tree | 5d55c24ac7f3ea66b7db9750aeb0e5ba3716075e /power-660.c | |
parent | f906ae2e7abb86978c77f8e449146343eba7cbb9 (diff) | |
download | vendor_qcom_opensource_power-ee9bd619746cb0425905baf354e7f52130bb2ef8.tar.gz vendor_qcom_opensource_power-ee9bd619746cb0425905baf354e7f52130bb2ef8.tar.bz2 vendor_qcom_opensource_power-ee9bd619746cb0425905baf354e7f52130bb2ef8.zip |
power: Use ARRAY_SIZE macro where possible
Change-Id: Ie47d0e6b91b7bba378b0fdf53a345a021b0c2d48
Diffstat (limited to 'power-660.c')
-rw-r--r-- | power-660.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/power-660.c b/power-660.c index 5c87fe8..15f9d02 100644 --- a/power-660.c +++ b/power-660.c @@ -120,7 +120,7 @@ int set_interactive_override(int on) { if (is_target_SDM630()) { int res[] = {0x41414000, 0x459, 0x41410000, 0x5F, 0x41400000, 0x4, 0x41820000, 0xA}; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); - num_resources = sizeof(res) / sizeof(res[0]); + num_resources = ARRAY_SIZE(res); } /* 1. CPUfreq params @@ -135,7 +135,7 @@ int set_interactive_override(int on) { int res[] = {0x41414100, 0x386, 0x41410100, 0x5F, 0x41400100, 0x4, 0x41820000, 0xA, 0x40C54000, 0x1F4}; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); - num_resources = sizeof(res) / sizeof(res[0]); + num_resources = ARRAY_SIZE(res); } perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values, num_resources); } @@ -199,8 +199,7 @@ static void process_video_encode_hint(void* metadata) { int res[] = {0x41414000, 0x459, 0x41410000, 0x5F, 0x41400000, 0x4, 0x41420000, 0x5F, 0x40C2C000, 0X5, 0x41820000, 0xA}; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); - num_resources = sizeof(res) / sizeof(res[0]); - + num_resources = ARRAY_SIZE(res); } /* 1. CPUfreq params @@ -213,7 +212,7 @@ static void process_video_encode_hint(void* metadata) { else { int res[] = {0x41414100, 0x386, 0x41410100, 0x5F, 0x41400100, 0x4, 0x41820000, 0xA}; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); - num_resources = sizeof(res) / sizeof(res[0]); + num_resources = ARRAY_SIZE(res); } camera_hint_ref_count++; if (camera_hint_ref_count == 1) { |