|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v5 3/4] pci: add wrapper for parse_pci
>>> On 23.05.15 at 03:33, <elena.ufimtseva@xxxxxxxxxx> wrote:
> --- a/xen/drivers/pci/pci.c
> +++ b/xen/drivers/pci/pci.c
> @@ -119,11 +119,21 @@ const char *__init parse_pci(const char *s, unsigned
> int *seg_p,
> unsigned int *bus_p, unsigned int *dev_p,
> unsigned int *func_p)
> {
> + int def_seg;
> + __parse_pci(s, seg_p, bus_p, dev_p, func_p, &def_seg);
> + return s;
By returning s instead of the return value of __parse_pci() you discard
errors.
Also, blank lines wanted between declarations and statements and
before the final return from a function.
> +const char *__init __parse_pci(const char *s, unsigned int *seg_p,
> + unsigned int *bus_p, unsigned int *dev_p,
> + unsigned int *func_p, int *def_seg)
> +{
> unsigned long seg = simple_strtoul(s, &s, 16), bus, dev, func;
>
> if ( *s != ':' )
> return NULL;
> bus = simple_strtoul(s + 1, &s, 16);
> + def_seg = 0;
*def_seg
> if ( *s == ':' )
> dev = simple_strtoul(s + 1, &s, 16);
> else
> @@ -131,6 +141,7 @@ const char *__init parse_pci(const char *s, unsigned int
> *seg_p,
> dev = bus;
> bus = seg;
> seg = 0;
> + *def_seg = 1;
Together with the earlier one, it looks like the type should be bool_t
instead of int.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |