summaryrefslogtreecommitdiff
path: root/common/dptf.c
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2020-10-07 12:13:52 +0200
committerCommit Bot <commit-bot@chromium.org>2020-10-27 09:35:49 +0000
commita05f7b9f469e7c171f4a737968ab5cbd11ba1253 (patch)
treeab128a89ce9206ca967ad104e307d6c0b4c33a52 /common/dptf.c
parent3cba51e9e807e7015d81c2891c47ea4c59587a1c (diff)
downloadchrome-ec-a05f7b9f469e7c171f4a737968ab5cbd11ba1253.tar.gz
tree: Use new atomic_* implementation
It is done as a part of porting to Zephyr. Since the implementation of atomic functions is done for all architectures use atomic_* instead of deprecated_atomic_*. Sometimes there was a compilation error "discards 'volatile' qualifier" due to dropping "volatile" in the argument of the functions, thus some pointers casts need to be made. It shouldn't cause any issues, because we are sure about generated asm (store operation will be performed). BUG=b:169151160 BRANCH=none TEST=buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I98f590c323c3af52035e62825e8acfa358e0805a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2478949 Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'common/dptf.c')
-rw-r--r--common/dptf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/dptf.c b/common/dptf.c
index f4fc6d0ff6..2a2cef0c17 100644
--- a/common/dptf.c
+++ b/common/dptf.c
@@ -47,7 +47,7 @@ int dptf_query_next_sensor_event(void)
for (id = 0; id < TEMP_SENSOR_COUNT; id++)
if (dptf_seen & BIT(id)) { /* atomic? */
- deprecated_atomic_clear_bits(&dptf_seen, BIT(id));
+ atomic_clear_bits(&dptf_seen, BIT(id));
return id;
}
@@ -79,13 +79,13 @@ static int dptf_check_temp_threshold(int sensor_id, int temp)
if (cond_went_true(&dptf_threshold[sensor_id][i].over)) {
CPRINTS("DPTF over threshold [%d][%d",
sensor_id, i);
- deprecated_atomic_or(&dptf_seen, BIT(sensor_id));
+ atomic_or(&dptf_seen, BIT(sensor_id));
tripped = 1;
}
if (cond_went_false(&dptf_threshold[sensor_id][i].over)) {
CPRINTS("DPTF under threshold [%d][%d",
sensor_id, i);
- deprecated_atomic_or(&dptf_seen, BIT(sensor_id));
+ atomic_or(&dptf_seen, BIT(sensor_id));
tripped = 1;
}
}
@@ -109,7 +109,7 @@ void dptf_set_temp_threshold(int sensor_id, int temp, int idx, int enable)
if (dptf_threshold[sensor_id][idx].temp == -1)
cond_init(&dptf_threshold[sensor_id][idx].over, 0);
dptf_threshold[sensor_id][idx].temp = temp;
- deprecated_atomic_clear_bits(&dptf_seen, BIT(sensor_id));
+ atomic_clear_bits(&dptf_seen, BIT(sensor_id));
} else {
dptf_threshold[sensor_id][idx].temp = -1;
}