>>> On 18.02.19 at 17:24, <roger....@citrix.com> 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....@citrix.com>

Reviewed-by: Jan Beulich <jbeul...@suse.com>
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@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to