From: Hongbo Zhang <hongbo.zhang@linaro.org>
To: linux@roeck-us.net, khali@linux-fr.org,
lm-sensors@lm-sensors.org, cbou@mail.ru, dwmw2@infradead.org
Cc: linaro-kernel@lists.linaro.org,
STEricsson_nomadik_linux@list.st.com, linus.walleij@linaro.org,
lee.jones@linaro.org, linux-kernel@vger.kernel.org,
Hongbo Zhang <hongbo.zhang@linaro.org>
Subject: [PATCH v7 3/5] ab8500: power: add const attributes to some data arrays
Date: Wed, 27 Mar 2013 15:13:30 +0800 [thread overview]
Message-ID: <1364368412-12810-4-git-send-email-hongbo.zhang@linaro.org> (raw)
In-Reply-To: <1364368412-12810-1-git-send-email-hongbo.zhang@linaro.org>
This patch adds const attributes to AB8500 power and temperature related
read-only data arrays.
Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
---
drivers/power/ab8500_bmdata.c | 18 +++++++++---------
drivers/power/ab8500_fg.c | 4 ++--
include/linux/mfd/abx500.h | 6 +++---
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
index f836550..9c25ca8 100644
--- a/drivers/power/ab8500_bmdata.c
+++ b/drivers/power/ab8500_bmdata.c
@@ -11,7 +11,7 @@
* Note that the res_to_temp table must be strictly sorted by falling resistance
* values to work.
*/
-static struct abx500_res_to_temp temp_tbl_a_thermistor[] = {
+static const struct abx500_res_to_temp temp_tbl_a_thermistor[] = {
{-5, 53407},
{ 0, 48594},
{ 5, 43804},
@@ -29,7 +29,7 @@ static struct abx500_res_to_temp temp_tbl_a_thermistor[] = {
{65, 12500},
};
-static struct abx500_res_to_temp temp_tbl_b_thermistor[] = {
+static const struct abx500_res_to_temp temp_tbl_b_thermistor[] = {
{-5, 200000},
{ 0, 159024},
{ 5, 151921},
@@ -47,7 +47,7 @@ static struct abx500_res_to_temp temp_tbl_b_thermistor[] = {
{65, 82869},
};
-static struct abx500_v_to_cap cap_tbl_a_thermistor[] = {
+static const struct abx500_v_to_cap cap_tbl_a_thermistor[] = {
{4171, 100},
{4114, 95},
{4009, 83},
@@ -70,7 +70,7 @@ static struct abx500_v_to_cap cap_tbl_a_thermistor[] = {
{3247, 0},
};
-static struct abx500_v_to_cap cap_tbl_b_thermistor[] = {
+static const struct abx500_v_to_cap cap_tbl_b_thermistor[] = {
{4161, 100},
{4124, 98},
{4044, 90},
@@ -93,7 +93,7 @@ static struct abx500_v_to_cap cap_tbl_b_thermistor[] = {
{3250, 0},
};
-static struct abx500_v_to_cap cap_tbl[] = {
+static const struct abx500_v_to_cap cap_tbl[] = {
{4186, 100},
{4163, 99},
{4114, 95},
@@ -124,7 +124,7 @@ static struct abx500_v_to_cap cap_tbl[] = {
* Note that the res_to_temp table must be strictly sorted by falling
* resistance values to work.
*/
-static struct abx500_res_to_temp temp_tbl[] = {
+static const struct abx500_res_to_temp temp_tbl[] = {
{-5, 214834},
{ 0, 162943},
{ 5, 124820},
@@ -146,7 +146,7 @@ static struct abx500_res_to_temp temp_tbl[] = {
* Note that the batres_vs_temp table must be strictly sorted by falling
* temperature values to work.
*/
-static struct batres_vs_temp temp_to_batres_tbl_thermistor[] = {
+static const struct batres_vs_temp temp_to_batres_tbl_thermistor[] = {
{ 40, 120},
{ 30, 135},
{ 20, 165},
@@ -160,7 +160,7 @@ static struct batres_vs_temp temp_to_batres_tbl_thermistor[] = {
* Note that the batres_vs_temp table must be strictly sorted by falling
* temperature values to work.
*/
-static struct batres_vs_temp temp_to_batres_tbl_ext_thermistor[] = {
+static const struct batres_vs_temp temp_to_batres_tbl_ext_thermistor[] = {
{ 60, 300},
{ 30, 300},
{ 20, 300},
@@ -171,7 +171,7 @@ static struct batres_vs_temp temp_to_batres_tbl_ext_thermistor[] = {
};
/* battery resistance table for LI ION 9100 battery */
-static struct batres_vs_temp temp_to_batres_tbl_9100[] = {
+static const struct batres_vs_temp temp_to_batres_tbl_9100[] = {
{ 60, 180},
{ 30, 180},
{ 20, 180},
diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
index b3bf178..d21456d 100644
--- a/drivers/power/ab8500_fg.c
+++ b/drivers/power/ab8500_fg.c
@@ -811,7 +811,7 @@ static int ab8500_fg_bat_voltage(struct ab8500_fg *di)
static int ab8500_fg_volt_to_capacity(struct ab8500_fg *di, int voltage)
{
int i, tbl_size;
- struct abx500_v_to_cap *tbl;
+ const struct abx500_v_to_cap *tbl;
int cap = 0;
tbl = di->bat->bat_type[di->bat->batt_id].v_to_cap_tbl,
@@ -863,7 +863,7 @@ static int ab8500_fg_uncomp_volt_to_capacity(struct ab8500_fg *di)
static int ab8500_fg_battery_resistance(struct ab8500_fg *di)
{
int i, tbl_size;
- struct batres_vs_temp *tbl;
+ const struct batres_vs_temp *tbl;
int resist = 0;
tbl = di->bat->bat_type[di->bat->batt_id].batres_tbl;
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
index 2138bd3..03fc0f1 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
@@ -173,11 +173,11 @@ struct abx500_battery_type {
int low_high_vol_lvl;
int battery_resistance;
int n_temp_tbl_elements;
- struct abx500_res_to_temp *r_to_t_tbl;
+ const struct abx500_res_to_temp *r_to_t_tbl;
int n_v_cap_tbl_elements;
- struct abx500_v_to_cap *v_to_cap_tbl;
+ const struct abx500_v_to_cap *v_to_cap_tbl;
int n_batres_tbl_elements;
- struct batres_vs_temp *batres_tbl;
+ const struct batres_vs_temp *batres_tbl;
};
/**
--
1.8.0
next prev parent reply other threads:[~2013-03-27 7:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-27 7:13 [PATCH v7 0/5] Add ST-Ericsson AB8500 HWMON driver Hongbo Zhang
2013-03-27 7:13 ` [PATCH v7 1/5] ab8500_btemp: make ab8500_btemp_get* interfaces public Hongbo Zhang
2013-03-27 7:13 ` [PATCH v7 2/5] ab8500: power: eliminate CamelCase warning of some variables Hongbo Zhang
2013-03-27 7:13 ` Hongbo Zhang [this message]
2013-03-27 7:13 ` [PATCH v7 4/5] ab8500: power: export abx500_res_to_temp tables for hwmon Hongbo Zhang
2013-03-27 19:47 ` Guenter Roeck
2013-03-27 7:13 ` [PATCH v7 5/5] hwmon: add ST-Ericsson ABX500 hwmon driver Hongbo Zhang
2013-03-27 19:48 ` Guenter Roeck
2013-03-28 2:31 ` Hongbo Zhang
2013-03-30 23:18 ` Anton Vorontsov
2013-03-30 23:27 ` Guenter Roeck
2013-03-31 19:59 ` Anton Vorontsov
2013-03-30 23:13 ` [PATCH v7 0/5] Add ST-Ericsson AB8500 HWMON driver Anton Vorontsov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364368412-12810-4-git-send-email-hongbo.zhang@linaro.org \
--to=hongbo.zhang@linaro.org \
--cc=STEricsson_nomadik_linux@list.st.com \
--cc=cbou@mail.ru \
--cc=dwmw2@infradead.org \
--cc=khali@linux-fr.org \
--cc=lee.jones@linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lm-sensors@lm-sensors.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).