[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/acpi: Don't fail if SPCR table is absent



On Thu, Oct 22, 2020 at 09:42:17AM +0200, Jan Beulich wrote:
> On 22.10.2020 00:12, Elliott Mitchell wrote:
> > --- a/xen/arch/arm/acpi/domain_build.c
> > +++ b/xen/arch/arm/acpi/domain_build.c
> > @@ -42,17 +42,18 @@ static int __init acpi_iomem_deny_access(struct domain 
> > *d)
> >      status = acpi_get_table(ACPI_SIG_SPCR, 0,
> >                              (struct acpi_table_header **)&spcr);
> >  
> > -    if ( ACPI_FAILURE(status) )
> > +    if ( ACPI_SUCCESS(status) )
> >      {
> > -        printk("Failed to get SPCR table\n");
> > -        return -EINVAL;
> > +        mfn = spcr->serial_port.address >> PAGE_SHIFT;
> > +        /* Deny MMIO access for UART */
> > +        rc = iomem_deny_access(d, mfn, mfn + 1);
> > +        if ( rc )
> > +            return rc;
> > +    }
> > +    else
> > +    {
> > +        printk("Failed to get SPCR table, Xen console may be 
> > unavailable\n");
> >      }
> 
> Nit: While I see you've got Stefano's R-b already, I Xen we typically
> omit the braces here.

Personally, I prefer that myself, but was unsure of the preference here.
I've seen multiple projects which *really* dislike using having brackets
for some clauses, but not others (ie they want either all clauses with or
all clauses without; instead of only if required).

I sent what I thought was the more often used format.  (I also like tabs,
and dislike having so many spaces; alas my preferences are apparently
uncommon)


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@xxxxxxx  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.