|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 34/52] xen/drivers/passthrough/pci.c: let custom parameter parsing routines return errno
>>> On 16.08.17 at 14:52, <jgross@xxxxxxxx> wrote:
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -149,17 +149,18 @@ static struct phantom_dev {
> } phantom_devs[8];
> static unsigned int nr_phantom_devs;
>
> -static void __init parse_phantom_dev(char *str) {
> +static int __init parse_phantom_dev(const char *str)
> +{
> const char *s = str;
> unsigned int seg, bus, slot;
> struct phantom_dev phantom;
>
> if ( !s || !*s || nr_phantom_devs >= ARRAY_SIZE(phantom_devs) )
> - return;
> + return -EINVAL;
I think you want to split the conditional and return e.g. -E2BIG for
there being too many devices. You could then at once drop the
pointless !s.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |