@@ -523,7 +523,7 @@ static int mvebu_pcie_handle_iobase_change(struct mvebu_pcie_port *port)
523523
524524 /* Are the new iobase/iolimit values invalid? */
525525 if (conf -> iolimit < conf -> iobase ||
526- conf -> iolimitupper < conf -> iobaseupper )
526+ le16_to_cpu ( conf -> iolimitupper ) < le16_to_cpu ( conf -> iobaseupper ) )
527527 return mvebu_pcie_set_window (port , port -> io_target , port -> io_attr ,
528528 & desired , & port -> iowin );
529529
@@ -535,10 +535,10 @@ static int mvebu_pcie_handle_iobase_change(struct mvebu_pcie_port *port)
535535 * is the CPU address.
536536 */
537537 desired .remap = ((conf -> iobase & 0xF0 ) << 8 ) |
538- (conf -> iobaseupper << 16 );
538+ (le16_to_cpu ( conf -> iobaseupper ) << 16 );
539539 desired .base = port -> pcie -> io .start + desired .remap ;
540540 desired .size = ((0xFFF | ((conf -> iolimit & 0xF0 ) << 8 ) |
541- (conf -> iolimitupper << 16 )) -
541+ (le16_to_cpu ( conf -> iolimitupper ) << 16 )) -
542542 desired .remap ) +
543543 1 ;
544544
@@ -552,7 +552,7 @@ static int mvebu_pcie_handle_membase_change(struct mvebu_pcie_port *port)
552552 struct pci_bridge_emul_conf * conf = & port -> bridge .conf ;
553553
554554 /* Are the new membase/memlimit values invalid? */
555- if (conf -> memlimit < conf -> membase )
555+ if (le16_to_cpu ( conf -> memlimit ) < le16_to_cpu ( conf -> membase ) )
556556 return mvebu_pcie_set_window (port , port -> mem_target , port -> mem_attr ,
557557 & desired , & port -> memwin );
558558
@@ -562,8 +562,8 @@ static int mvebu_pcie_handle_membase_change(struct mvebu_pcie_port *port)
562562 * window to setup, according to the PCI-to-PCI bridge
563563 * specifications.
564564 */
565- desired .base = ((conf -> membase & 0xFFF0 ) << 16 );
566- desired .size = (((conf -> memlimit & 0xFFF0 ) << 16 ) | 0xFFFFF ) -
565+ desired .base = ((le16_to_cpu ( conf -> membase ) & 0xFFF0 ) << 16 );
566+ desired .size = (((le16_to_cpu ( conf -> memlimit ) & 0xFFF0 ) << 16 ) | 0xFFFFF ) -
567567 desired .base + 1 ;
568568
569569 return mvebu_pcie_set_window (port , port -> mem_target , port -> mem_attr , & desired ,
0 commit comments