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

Re: [Xen-devel] [PATCH for-4.12] vpci: reduce verboseness of BAR write warnings



>>> On 18.02.19 at 17:24, <roger.pau@xxxxxxxxxx> wrote:
> Avoid printing a warning message when writing to a BAR register with
> memory decoding enabled if the value written is the same as the
> current one.
> 
> No functional change.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with one cosmetic question:

> @@ -381,6 +371,19 @@ static void bar_write(const struct pci_dev *pdev, 
> unsigned int reg,
>      else
>          val &= PCI_BASE_ADDRESS_MEM_MASK;
>  
> +    if ( pci_conf_read16(pdev->seg, pdev->bus, slot, func, PCI_COMMAND) &
> +         PCI_COMMAND_MEMORY )
> +    {
> +        /* If the value written is the current one avoid printing a warning. 
> */
> +        if ( val != (uint32_t)(bar->addr >> (hi ? 32 : 0)) )
> +            gprintk(XENLOG_WARNING,
> +                    "%04x:%02x:%02x.%u: ignored BAR %lu write with memory 
> decoding enabled\n",
> +                    pdev->seg, pdev->bus, slot, func,
> +                    bar - pdev->vpci->header.bars + (hi ? 1 : 0));

Why the conditional operator? bool converts fine to an integer
value of 0 or 1.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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