Re: [PATCH v2 2/2] PCI: hv: Refactor hv_irq_unmask() to use cpumask_to_vpset()

From: Maya Nakamura
Date: Tue Jan 29 2019 - 00:53:03 EST


On Sun, Jan 27, 2019 at 05:22:06AM +0000, Michael Kelley wrote:
> From: Maya Nakamura <m.maya.nakamura@xxxxxxxxx> Sent: Saturday, January 26, 2019 12:55 AM
> >
> > @@ -953,29 +951,27 @@ static void hv_irq_unmask(struct irq_data *data)
> > */
> > params->int_target.flags |=
> > HV_DEVICE_INTERRUPT_TARGET_PROCESSOR_SET;
> > - params->int_target.vp_set.valid_bank_mask =
> > - (1ull << HV_VP_SET_BANK_COUNT_MAX) - 1;
> > +
> > + if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) {
> > + res = 1;
> > + goto exit_unlock;
> > + }
> > +
> > + cpumask_and(tmp, dest, cpu_online_mask);
> > + nr_bank = cpumask_to_vpset(&params->int_target.vp_set, tmp);
> > + free_cpumask_var(tmp);
> > +
> > + if (!nr_bank) {
>
> There are two failures cases in cpumask_to_vpset(). One case returns
> 0, and the other case returns -1. The above test only catches the 0
> failure case. Need to modify the test to catch both cases.
>
> Michael
>
Thank you for your feedback. I will correct it in v3.

Maya

> > + res = 1;
> > + goto exit_unlock;
> > + }
> >
>