From 0e1055fc195165662acbc9a4f165aadb72f150fb Mon Sep 17 00:00:00 2001 From: Brett Simmers Date: Wed, 14 Feb 2024 18:17:13 -0800 Subject: [PATCH] Remove unnecessary NULL check, add uint32_t cast --- Python/ceval_gil.c | 4 ---- Python/instrumentation.c | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Python/ceval_gil.c b/Python/ceval_gil.c index 779d80575f3641..f5c44307a513f8 100644 --- a/Python/ceval_gil.c +++ b/Python/ceval_gil.c @@ -84,10 +84,6 @@ update_eval_breaker_for_thread(PyInterpreterState *interp, PyThreadState *tstate return; #endif - if (tstate == NULL) { - return; - } - int32_t calls_to_do = _Py_atomic_load_int32_relaxed( &interp->ceval.pending.calls_to_do); if (calls_to_do) { diff --git a/Python/instrumentation.c b/Python/instrumentation.c index 0c9f6faa728774..878d19f0552bf5 100644 --- a/Python/instrumentation.c +++ b/Python/instrumentation.c @@ -891,7 +891,8 @@ static inline int most_significant_bit(uint8_t bits) { static uint32_t global_version(PyInterpreterState *interp) { - return _Py_atomic_load_uintptr_relaxed(&interp->ceval.instrumentation_version); + return (uint32_t)_Py_atomic_load_uintptr_relaxed( + &interp->ceval.instrumentation_version); } /* Atomically set the given version in the given location, without touching