Hi, At 16:12 +0100 on 21 Jun (1498061549), Andrew Cooper wrote: > sh_emulate_map_dest() predates the introduction of the generic ERR_PTR() > infrasturcture, but take the opportunity to avoid opencoding it.
s/sturct/struct/. > @@ -4752,8 +4752,8 @@ sh_x86_emulate_write(struct vcpu *v, unsigned long > vaddr, void *src, > return X86EMUL_UNHANDLEABLE; > > addr = sh_emulate_map_dest(v, vaddr, bytes, sh_ctxt); > - if ( sh_emulate_map_dest_failed(addr) ) > - return (long)addr; > + if ( IS_ERR(addr) ) > + return ~PTR_ERR(addr); Using "return ~PTR_ERR(addr)" when the usual idiom is "return -PTR_ERR(foo)" is a bit subtle. Still, the code seems to be correct, so if people prefer it, Acked-by: Tim Deegan <t...@xen.org> Cheers, Tim. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel