pci: fix unaligned access in pci_xxx_quad()
commit059a65f3ad506105ac9b5b0c7c31f8a0be0abbbc
authorDmitry Fleytman <dmitry.fleytman@ravellosystems.com>
Wed, 1 Jun 2016 08:23:30 +0000 (1 11:23 +0300)
committerJason Wang <jasowang@redhat.com>
Thu, 2 Jun 2016 02:16:53 +0000 (2 10:16 +0800)
tree40acd9328a3fa3adb1845eadf22e1a26cbd88cd0
parent16a3df403b10c4ac347159e39005fd520b2648bb
pci: fix unaligned access in pci_xxx_quad()

Replace legacy cpu_to_le64w()/le64_to_cpup()
calls with stq_le_p()/ldq_le_p().

Motivation for this modification is that
follow up patches add utility function
pcie_dev_ser_num_init() for PCIe DSN
capability creation which uses
pci_set_quad() with a misaligned offset.

Signed-off-by: Dmitry Fleytman <dmitry.fleytman@ravellosystems.com>
Signed-off-by: Leonid Bloch <leonid.bloch@ravellosystems.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
include/hw/pci/pci.h