]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: s390: Silence potential warnings in _gmap_crstep_xchg_atomic()
authorClaudio Imbrenda <imbrenda@linux.ibm.com>
Thu, 11 Jun 2026 10:48:46 +0000 (12:48 +0200)
committerClaudio Imbrenda <imbrenda@linux.ibm.com>
Thu, 11 Jun 2026 11:50:09 +0000 (13:50 +0200)
While dat_crstep_xchg_atomic() is marked as __must_check, in this
particular case the return value should be ignored.

Silence potential compiler warnings with a pointless check, and add a
comment to explain the situation.

Fixes: d1adc098ce08 ("KVM: s390: Fix _gmap_crstep_xchg_atomic()")
CC: stable@vger.kernel.org # 7.1
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260611104850.110313-2-imbrenda@linux.ibm.com>

arch/s390/kvm/gmap.h

index 5374f21aaf8dfa2cd2259b4c901f3465ba373925..20881e3ce9d86cee1dd8ec196fa27babeff15e06 100644 (file)
@@ -279,7 +279,16 @@ static inline bool __must_check _gmap_crstep_xchg_atomic(struct gmap *gmap, unio
                        gmap_handle_vsie_unshadow_event(gmap, gfn);
                else
                        _gmap_handle_vsie_unshadow_event(gmap, gfn);
-               dat_crstep_xchg_atomic(crstep, oldcrste, newcrste, gfn, gmap->asce);
+               if (!dat_crstep_xchg_atomic(crstep, oldcrste, newcrste, gfn, gmap->asce))
+                       return false;
+               /*
+                * Return false even if the swap was successful, as it only
+                * indicates that the best effort clearing of the vsie_notif
+                * bit was successful. The caller will have to try again
+                * regardless, since the desired value has not been set.
+                * This pointless check is needed to silence a potential
+                * __must_check warning.
+                */
                return false;
        }
        if (!oldcrste.s.fc1.d && newcrste.s.fc1.d && !newcrste.s.fc1.s)