[PATCH] s390/time: use assign_bit() where applicable
From: Peng Fan (OSS)
Date: Sat Sep 19 2026 - 22:36:20 EST
From: Peng Fan <peng.fan@xxxxxxx>
Convert open-coded if/else with set_bit/clear_bit to the assign_bit API.
Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
arch/s390/kernel/time.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 2b989bebd220..3225a66abfce 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -501,10 +501,7 @@ static int __store_stpinfo(void)
{
int rc = chsc_sstpi(stp_page, &stp_info, sizeof(struct stp_sstpi));
- if (rc)
- clear_bit(CLOCK_SYNC_STPINFO_VALID, &clock_sync_flags);
- else
- set_bit(CLOCK_SYNC_STPINFO_VALID, &clock_sync_flags);
+ assign_bit(CLOCK_SYNC_STPINFO_VALID, &clock_sync_flags, !rc);
return rc;
}
@@ -795,10 +792,7 @@ static ssize_t online_store(struct device *dev,
return -EOPNOTSUPP;
mutex_lock(&stp_mutex);
stp_online = value;
- if (stp_online)
- set_bit(CLOCK_SYNC_STP, &clock_sync_flags);
- else
- clear_bit(CLOCK_SYNC_STP, &clock_sync_flags);
+ assign_bit(CLOCK_SYNC_STP, &clock_sync_flags, stp_online);
queue_work(time_sync_wq, &stp_work);
mutex_unlock(&stp_mutex);
return count;
--
2.51.0