summaryrefslogtreecommitdiff
path: root/chip/it83xx/i2c.c
diff options
context:
space:
mode:
authorShamile Khan <shamile.khan@intel.com>2015-11-24 13:27:01 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-12-01 18:52:53 -0800
commitf748a7fbd5c72c659b60d772db1c3d398a746455 (patch)
tree92bc49f36b53b26ac1a91cec920200334b4c994c /chip/it83xx/i2c.c
parent9167ce023260fa089e9aa741eb36902484c33154 (diff)
downloadchrome-ec-f748a7fbd5c72c659b60d772db1c3d398a746455.tar.gz
common: adc/i2c: Mark task_waiting volatile
When Link Time Optimization is turned on, functions that set task_waiting multiple times have one of the sets removed by the linker leading to undesired results. Marking task_waiting volatile alleviates this issue. BUG=chrome-os-partner:46063 TEST=Manually tested on Kunimitsu. Console command adc shows correct value of approx 20000 mV for VBUS. BRANCH=none Change-Id: I85a6e5c9688ae72c45d90fb58296f94b74a301aa Signed-off-by: Shamile Khan <shamile.khan@intel.com> Reviewed-on: https://chromium-review.googlesource.com/314233 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/it83xx/i2c.c')
-rw-r--r--chip/it83xx/i2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/it83xx/i2c.c b/chip/it83xx/i2c.c
index d2aac92604..bc10a5970f 100644
--- a/chip/it83xx/i2c.c
+++ b/chip/it83xx/i2c.c
@@ -137,7 +137,7 @@ struct i2c_port_data {
enum i2c_ch_status i2ccs;
/* Task waiting on port, or TASK_ID_INVALID if none. */
- int task_waiting;
+ volatile int task_waiting;
};
static struct i2c_port_data pdata[I2C_PORT_COUNT];