Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ab8500_{bmdata,fg}: Add const attributes to some data arrays

This patch adds const attributes to AB8500 power and temperature related
read-only data arrays.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>

authored by

Hongbo Zhang and committed by
Anton Vorontsov
2c899407 6c1f8e02

+15 -15
+10 -10
drivers/power/ab8500_bmdata.c
··· 11 11 * Note that the res_to_temp table must be strictly sorted by falling resistance 12 12 * values to work. 13 13 */ 14 - static struct abx500_res_to_temp temp_tbl_a_thermistor[] = { 14 + static const struct abx500_res_to_temp temp_tbl_a_thermistor[] = { 15 15 {-5, 53407}, 16 16 { 0, 48594}, 17 17 { 5, 43804}, ··· 29 29 {65, 12500}, 30 30 }; 31 31 32 - static struct abx500_res_to_temp temp_tbl_b_thermistor[] = { 32 + static const struct abx500_res_to_temp temp_tbl_b_thermistor[] = { 33 33 {-5, 200000}, 34 34 { 0, 159024}, 35 35 { 5, 151921}, ··· 47 47 {65, 82869}, 48 48 }; 49 49 50 - static struct abx500_v_to_cap cap_tbl_a_thermistor[] = { 50 + static const struct abx500_v_to_cap cap_tbl_a_thermistor[] = { 51 51 {4171, 100}, 52 52 {4114, 95}, 53 53 {4009, 83}, ··· 70 70 {3247, 0}, 71 71 }; 72 72 73 - static struct abx500_v_to_cap cap_tbl_b_thermistor[] = { 73 + static const struct abx500_v_to_cap cap_tbl_b_thermistor[] = { 74 74 {4161, 100}, 75 75 {4124, 98}, 76 76 {4044, 90}, ··· 93 93 {3250, 0}, 94 94 }; 95 95 96 - static struct abx500_v_to_cap cap_tbl[] = { 96 + static const struct abx500_v_to_cap cap_tbl[] = { 97 97 {4186, 100}, 98 98 {4163, 99}, 99 99 {4114, 95}, ··· 124 124 * Note that the res_to_temp table must be strictly sorted by falling 125 125 * resistance values to work. 126 126 */ 127 - static struct abx500_res_to_temp temp_tbl[] = { 127 + static const struct abx500_res_to_temp temp_tbl[] = { 128 128 {-5, 214834}, 129 129 { 0, 162943}, 130 130 { 5, 124820}, ··· 146 146 * Note that the batres_vs_temp table must be strictly sorted by falling 147 147 * temperature values to work. 148 148 */ 149 - static struct batres_vs_temp temp_to_batres_tbl_thermistor[] = { 149 + static const struct batres_vs_temp temp_to_batres_tbl_thermistor[] = { 150 150 { 40, 120}, 151 151 { 30, 135}, 152 152 { 20, 165}, ··· 160 160 * Note that the batres_vs_temp table must be strictly sorted by falling 161 161 * temperature values to work. 162 162 */ 163 - static struct batres_vs_temp temp_to_batres_tbl_ext_thermistor[] = { 163 + static const struct batres_vs_temp temp_to_batres_tbl_ext_thermistor[] = { 164 164 { 60, 300}, 165 165 { 30, 300}, 166 166 { 20, 300}, ··· 171 171 }; 172 172 173 173 /* battery resistance table for LI ION 9100 battery */ 174 - static struct batres_vs_temp temp_to_batres_tbl_9100[] = { 174 + static const struct batres_vs_temp temp_to_batres_tbl_9100[] = { 175 175 { 60, 180}, 176 176 { 30, 180}, 177 177 { 20, 180}, ··· 547 547 struct device_node *np, 548 548 struct abx500_bm_data *bm) 549 549 { 550 - struct batres_vs_temp *tmp_batres_tbl; 550 + const struct batres_vs_temp *tmp_batres_tbl; 551 551 struct device_node *battery_node; 552 552 const char *btech; 553 553 int i;
+2 -2
drivers/power/ab8500_fg.c
··· 863 863 static int ab8500_fg_volt_to_capacity(struct ab8500_fg *di, int voltage) 864 864 { 865 865 int i, tbl_size; 866 - struct abx500_v_to_cap *tbl; 866 + const struct abx500_v_to_cap *tbl; 867 867 int cap = 0; 868 868 869 869 tbl = di->bm->bat_type[di->bm->batt_id].v_to_cap_tbl, ··· 915 915 static int ab8500_fg_battery_resistance(struct ab8500_fg *di) 916 916 { 917 917 int i, tbl_size; 918 - struct batres_vs_temp *tbl; 918 + const struct batres_vs_temp *tbl; 919 919 int resist = 0; 920 920 921 921 tbl = di->bm->bat_type[di->bm->batt_id].batres_tbl;
+3 -3
include/linux/mfd/abx500.h
··· 183 183 int low_high_vol_lvl; 184 184 int battery_resistance; 185 185 int n_temp_tbl_elements; 186 - struct abx500_res_to_temp *r_to_t_tbl; 186 + const struct abx500_res_to_temp *r_to_t_tbl; 187 187 int n_v_cap_tbl_elements; 188 - struct abx500_v_to_cap *v_to_cap_tbl; 188 + const struct abx500_v_to_cap *v_to_cap_tbl; 189 189 int n_batres_tbl_elements; 190 - struct batres_vs_temp *batres_tbl; 190 + const struct batres_vs_temp *batres_tbl; 191 191 }; 192 192 193 193 /**