lkml.org 
[lkml]   [2019]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 2/2] PCI: hv: Refactor hv_irq_unmask() to use cpumask_to_vpset()
On Sun, Jan 27, 2019 at 05:22:06AM +0000, Michael Kelley wrote:
> From: Maya Nakamura <m.maya.nakamura@gmail.com> 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;
> > + }
> >
>

\
 
 \ /
  Last update: 2019-01-29 06:54    [W:0.122 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site