]> xenbits.xensource.com Git - xen.git/commit
xen/arm: pci: fix -Wtype-limits warning in pci-host-common.c
authorStewart Hildebrand <stewart.hildebrand@amd.com>
Wed, 3 May 2023 19:18:20 +0000 (15:18 -0400)
committerJulien Grall <jgrall@amazon.com>
Thu, 11 May 2023 11:57:36 +0000 (12:57 +0100)
commitcb781ae2c98de5d5742aa0de6850f371fb25825f
tree5c44e64ed20e24a2333addd45b227c7f60267673
parentbdb1184d4f6bf4e0121fda34a6c1cb51fe270e7d
xen/arm: pci: fix -Wtype-limits warning in pci-host-common.c

When building with EXTRA_CFLAGS_XEN_CORE="-Wtype-limits", we observe the
following warning:

arch/arm/pci/pci-host-common.c: In function ‘pci_host_common_probe’:
arch/arm/pci/pci-host-common.c:238:26: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  238 |     if ( bridge->segment < 0 )
      |                          ^

This is due to bridge->segment being an unsigned type. Fix it by introducing a
new variable of signed type to use in the condition.

Fixes: 6ec9176d94ae ("xen/arm: PCI host bridge discovery within XEN on ARM")
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Rahul Singh <rahul.singh@arm.com<mailto:rahul.singh@arm.com>>
xen/arch/arm/pci/pci-host-common.c