On Mon, Nov 19, 2018 at 06:25:30PM +0100, Michael Mueller wrote: > The function atomically returns the address of the first > GISA of this list and stores a zero address in the origin > list field of the GIB instead. > > The GIB alert list contains all GISAs that have pending > adapter interruptions. > > Signed-off-by: Michael Mueller <mimu@xxxxxxxxxxxxx> > Reviewed-by: Pierre Morel <pmorel@xxxxxxxxxxxxx> ... > +static struct kvm_s390_gisa __maybe_unused *unlink_gib_alert_list(void) > +{ > + u32 gisa; > + > + if (!gib) > + return NULL; > + ... > + do { > + gisa = READ_ONCE(gib->alert_list_origin); > + } while (cmpxchg(&gib->alert_list_origin, gisa, 0) != gisa); > + > + return (void *)(u64) gisa; > +} Please make this shorter: return (void *)(u64) xchg(&gib->alert_list_origin, gisa, 0);