Message ID | 42688c2b-9f11-4c52-b83a-607374a858fd@suse.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | x86/PV: don't half-open-code SIF_PM_MASK | expand |
On 19/02/2025 10:02 am, Jan Beulich wrote: > Avoid using the same literal number (8) in two distinct places. You say two places but this is only one hunk. I presume you mean SIF_PM_MASK as the other place. In which case I'd suggest that this would be clearer if phrased as "Use MASK_INTR() to avoid opencoding the literal 8." > > Signed-off-by: Jan Beulich <jbeulich@suse.com> Preferably with some kind of adjustment to the commit message, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
On 19.02.2025 11:29, Andrew Cooper wrote: > On 19/02/2025 10:02 am, Jan Beulich wrote: >> Avoid using the same literal number (8) in two distinct places. > > You say two places but this is only one hunk. I presume you mean > SIF_PM_MASK as the other place. Indeed. Somewhere there needs to be a literal number. Just that it should be only one place rather than two. Obviously that other place isn't touched, and hence isn't visible in the patch itself. > In which case I'd suggest that this would be clearer if phrased as "Use > MASK_INTR() to avoid opencoding the literal 8." I've appended this to the sentence there was, i.e "..., using MASK_INTR() ...". To be honest, given the simplicity of the code change, I didn't think it would be necessary to also say this verbally. >> Signed-off-by: Jan Beulich <jbeulich@suse.com> > > Preferably with some kind of adjustment to the commit message, Acked-by: > Andrew Cooper <andrew.cooper3@citrix.com> Thanks. Jan
On 19/02/2025 10:34 am, Jan Beulich wrote: > On 19.02.2025 11:29, Andrew Cooper wrote: >> On 19/02/2025 10:02 am, Jan Beulich wrote: >>> Avoid using the same literal number (8) in two distinct places. >> You say two places but this is only one hunk. I presume you mean >> SIF_PM_MASK as the other place. > Indeed. Somewhere there needs to be a literal number. Just that it should > be only one place rather than two. Obviously that other place isn't > touched, and hence isn't visible in the patch itself. > >> In which case I'd suggest that this would be clearer if phrased as "Use >> MASK_INTR() to avoid opencoding the literal 8." > I've appended this to the sentence there was, i.e "..., using MASK_INTR() > ...". To be honest, given the simplicity of the code change, I didn't > think it would be necessary to also say this verbally. Honestly, you saying "two distinct places" for a while made me think you'd forgotten a hunk. It took longer than I care to admin to realise that the change was in fact correct as-is. ~Andrew
--- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -886,7 +886,7 @@ static int __init dom0_construct(struct si->flags = SIF_PRIVILEGED | SIF_INITDOMAIN; if ( !vinitrd_start && initrd_len ) si->flags |= SIF_MOD_START_PFN; - si->flags |= (xen_processor_pmbits << 8) & SIF_PM_MASK; + si->flags |= MASK_INSR(xen_processor_pmbits, SIF_PM_MASK); si->pt_base = vpt_start; si->nr_pt_frames = nr_pt_pages; si->mfn_list = vphysmap_start;
Avoid using the same literal number (8) in two distinct places. Signed-off-by: Jan Beulich <jbeulich@suse.com>