src/[arch-lib]: change "unsigned" to "unsigned int"

Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: Ibb7b48a7a144421aff29acbb7ac30968ae5fe5ab
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36329
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
diff --git a/src/device/device_util.c b/src/device/device_util.c
index d8a8431..36bcbe9 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -25,7 +25,7 @@
  * @param apic_id The Local APIC ID number.
  * @return Pointer to the device structure (if found), 0 otherwise.
  */
-struct device *dev_find_lapic(unsigned apic_id)
+struct device *dev_find_lapic(unsigned int apic_id)
 {
 	struct device *dev;
 	struct device *result = NULL;
@@ -325,7 +325,7 @@
  * @param index The index of the resource on the device.
  * @return The resource, if it already exists.
  */
-struct resource *probe_resource(const struct device *dev, unsigned index)
+struct resource *probe_resource(const struct device *dev, unsigned int index)
 {
 	struct resource *res;
 
@@ -348,7 +348,7 @@
  * @param index The index of the resource on the device.
  * @return TODO.
  */
-struct resource *new_resource(struct device *dev, unsigned index)
+struct resource *new_resource(struct device *dev, unsigned int index)
 {
 	struct resource *resource, *tail;
 
@@ -395,7 +395,7 @@
  * @param index The index of the resource on the device.
  * return TODO.
  */
-struct resource *find_resource(const struct device *dev, unsigned index)
+struct resource *find_resource(const struct device *dev, unsigned int index)
 {
 	struct resource *resource;
 
diff --git a/src/device/hypertransport.c b/src/device/hypertransport.c
index 1a8f7e6..03e3375 100644
--- a/src/device/hypertransport.c
+++ b/src/device/hypertransport.c
@@ -21,7 +21,7 @@
 
 struct ht_link {
 	struct device *dev;
-	unsigned pos;
+	unsigned int pos;
 	unsigned char ctrl_off, config_off, freq_off, freq_cap_off;
 };
 
@@ -64,7 +64,7 @@
 	return first;
 }
 
-static int ht_setup_link(struct ht_link *prev, struct device *dev, unsigned pos)
+static int ht_setup_link(struct ht_link *prev, struct device *dev, unsigned int pos)
 {
 	struct ht_link cur[1];
 	int linkb_to_host;
@@ -113,9 +113,9 @@
 	return 0;
 }
 
-static unsigned ht_lookup_slave_capability(struct device *dev)
+static unsigned int ht_lookup_slave_capability(struct device *dev)
 {
-	unsigned pos;
+	unsigned int pos;
 
 	pos = 0;
 	do {
@@ -135,7 +135,7 @@
 }
 
 static void ht_collapse_early_enumeration(struct bus *bus,
-					  unsigned offset_unitid)
+					  unsigned int offset_unitid)
 {
 	unsigned int devfn;
 	struct ht_link prev;
@@ -207,7 +207,7 @@
 	for (devfn = PCI_DEVFN(1, 0); devfn <= 0xff; devfn += 8) {
 		struct device dummy;
 		u32 id;
-		unsigned pos, flags;
+		unsigned int pos, flags;
 
 		dummy.bus = bus;
 		dummy.path.type = DEVICE_PATH_PCI;
@@ -236,10 +236,10 @@
 	}
 }
 
-static unsigned int do_hypertransport_scan_chain(struct bus *bus, unsigned min_devfn,
-				       unsigned max_devfn,
-				       unsigned *ht_unitid_base,
-				       unsigned offset_unitid)
+static unsigned int do_hypertransport_scan_chain(struct bus *bus, unsigned int min_devfn,
+				       unsigned int max_devfn,
+				       unsigned int *ht_unitid_base,
+				       unsigned int offset_unitid)
 {
 	/*
 	 * Even CONFIG_HT_CHAIN_UNITID_BASE == 0, we still can go through this
diff --git a/src/device/i2c.c b/src/device/i2c.c
index fb29b72..72e5525 100644
--- a/src/device/i2c.c
+++ b/src/device/i2c.c
@@ -14,7 +14,7 @@
 #include <device/i2c_simple.h>
 #include <stdint.h>
 
-int i2c_read_field(unsigned bus, uint8_t chip, uint8_t reg, uint8_t *data,
+int i2c_read_field(unsigned int bus, uint8_t chip, uint8_t reg, uint8_t *data,
 		   uint8_t mask, uint8_t shift)
 {
 	int ret;
@@ -28,7 +28,7 @@
 	return ret;
 }
 
-int i2c_write_field(unsigned bus, uint8_t chip, uint8_t reg, uint8_t data,
+int i2c_write_field(unsigned int bus, uint8_t chip, uint8_t reg, uint8_t data,
 		    uint8_t mask, uint8_t shift)
 {
 	int ret;
diff --git a/src/device/oprom/x86emu/decode.c b/src/device/oprom/x86emu/decode.c
index b7a6f35..3b7bde7 100644
--- a/src/device/oprom/x86emu/decode.c
+++ b/src/device/oprom/x86emu/decode.c
@@ -735,7 +735,7 @@
 Decodes scale/index of SIB byte and returns relevant offset part of
 effective address.
 ****************************************************************************/
-static unsigned decode_sib_si(
+static unsigned int decode_sib_si(
     int scale,
     int index)
 {
@@ -785,7 +785,7 @@
 REMARKS:
 Decodes SIB addressing byte and returns calculated effective address.
 ****************************************************************************/
-static unsigned decode_sib_address(
+static unsigned int decode_sib_address(
     int mod)
 {
     int sib   = fetch_byte_imm();
@@ -874,10 +874,10 @@
         if a SS access is needed, set this bit.  Otherwise, DS access
         occurs (unless any of the segment override bits are set).
 ****************************************************************************/
-unsigned decode_rm00_address(
+unsigned int decode_rm00_address(
     int rm)
 {
-    unsigned offset;
+    unsigned int offset;
 
     if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
         /* 32-bit addressing */
@@ -954,7 +954,7 @@
 Return the offset given by mod=01 addressing.  Also enables the
 decoding of instructions.
 ****************************************************************************/
-unsigned decode_rm01_address(
+unsigned int decode_rm01_address(
     int rm)
 {
     int displacement;
@@ -1043,7 +1043,7 @@
 Return the offset given by mod=10 addressing.  Also enables the
 decoding of instructions.
 ****************************************************************************/
-unsigned decode_rm10_address(
+unsigned int decode_rm10_address(
     int rm)
 {
     if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
@@ -1136,7 +1136,7 @@
 Return the offset given by "mod" addressing.
 ****************************************************************************/
 
-unsigned decode_rmXX_address(int mod, int rm)
+unsigned int decode_rmXX_address(int mod, int rm)
 {
   if (mod == 0)
     return decode_rm00_address(rm);
diff --git a/src/device/oprom/x86emu/decode.h b/src/device/oprom/x86emu/decode.h
index 99ed7f6..530b7d9 100644
--- a/src/device/oprom/x86emu/decode.h
+++ b/src/device/oprom/x86emu/decode.h
@@ -76,10 +76,10 @@
 u16* 	decode_rm_word_register(int reg);
 u32* 	decode_rm_long_register(int reg);
 u16* 	decode_rm_seg_register(int reg);
-unsigned decode_rm00_address(int rm);
-unsigned decode_rm01_address(int rm);
-unsigned decode_rm10_address(int rm);
-unsigned decode_rmXX_address(int mod, int rm);
+unsigned int decode_rm00_address(int rm);
+unsigned int decode_rm01_address(int rm);
+unsigned int decode_rm10_address(int rm);
+unsigned int decode_rmXX_address(int mod, int rm);
 
 #ifdef  __cplusplus
 }                       			/* End of "C" linkage for C++   	*/
diff --git a/src/device/pci_device.c b/src/device/pci_device.c
index 191c846..36b7c82 100644
--- a/src/device/pci_device.c
+++ b/src/device/pci_device.c
@@ -345,7 +345,7 @@
 }
 
 static void pci_record_bridge_resource(struct device *dev, resource_t moving,
-				       unsigned index, unsigned long type)
+				       unsigned int index, unsigned long type)
 {
 	struct resource *resource;
 	unsigned long gran;
@@ -1162,8 +1162,8 @@
  * @param min_devfn Minimum devfn to look at in the scan, usually 0x00.
  * @param max_devfn Maximum devfn to look at in the scan, usually 0xff.
  */
-void pci_scan_bus(struct bus *bus, unsigned min_devfn,
-			  unsigned max_devfn)
+void pci_scan_bus(struct bus *bus, unsigned int min_devfn,
+			  unsigned int max_devfn)
 {
 	unsigned int devfn;
 	struct device *dev, **prev;
@@ -1311,8 +1311,8 @@
  */
 void do_pci_scan_bridge(struct device *dev,
 				void (*do_scan_bus) (struct bus * bus,
-							     unsigned min_devfn,
-							     unsigned max_devfn))
+							     unsigned int min_devfn,
+							     unsigned int max_devfn))
 {
 	struct bus *bus;
 
diff --git a/src/device/pciexp_device.c b/src/device/pciexp_device.c
index 71702a7..72aac4c 100644
--- a/src/device/pciexp_device.c
+++ b/src/device/pciexp_device.c
@@ -45,7 +45,7 @@
  * Re-train a PCIe link
  */
 #define PCIE_TRAIN_RETRY 10000
-static int pciexp_retrain_link(struct device *dev, unsigned cap)
+static int pciexp_retrain_link(struct device *dev, unsigned int cap)
 {
 	unsigned int try;
 	u16 lnk;
@@ -90,8 +90,8 @@
  * and enable Common Clock Configuration if possible.  If CCC is
  * enabled the link must be retrained.
  */
-static void pciexp_enable_common_clock(struct device *root, unsigned root_cap,
-				       struct device *endp, unsigned endp_cap)
+static void pciexp_enable_common_clock(struct device *root, unsigned int root_cap,
+				       struct device *endp, unsigned int endp_cap)
 {
 	u16 root_scc, endp_scc, lnkctl;
 
@@ -122,7 +122,7 @@
 	}
 }
 
-static void pciexp_enable_clock_power_pm(struct device *endp, unsigned endp_cap)
+static void pciexp_enable_clock_power_pm(struct device *endp, unsigned int endp_cap)
 {
 	/* check if per port clk req is supported in device */
 	u32 endp_ca;
@@ -328,8 +328,8 @@
  * by checking both root port and endpoint and returning
  * the highest latency value.
  */
-static int pciexp_aspm_latency(struct device *root, unsigned root_cap,
-			       struct device *endp, unsigned endp_cap,
+static int pciexp_aspm_latency(struct device *root, unsigned int root_cap,
+			       struct device *endp, unsigned int endp_cap,
 			       enum aspm_type type)
 {
 	int root_lat = 0, endp_lat = 0;
@@ -364,8 +364,8 @@
 /*
  * Enable ASPM on PCIe root port and endpoint.
  */
-static void pciexp_enable_aspm(struct device *root, unsigned root_cap,
-					 struct device *endp, unsigned endp_cap)
+static void pciexp_enable_aspm(struct device *root, unsigned int root_cap,
+					 struct device *endp, unsigned int endp_cap)
 {
 	const char *aspm_type_str[] = { "None", "L0s", "L1", "L0s and L1" };
 	enum aspm_type apmc = PCIE_ASPM_NONE;
diff --git a/src/device/software_i2c.c b/src/device/software_i2c.c
index 5dc9990..3bb9708 100644
--- a/src/device/software_i2c.c
+++ b/src/device/software_i2c.c
@@ -38,7 +38,7 @@
  * Waits until either timeout_us have passed or (iff for_scl is set) until SCL
  * goes high. Will report random line changes during the wait and return SCL.
  */
-static int __wait(unsigned bus, int timeout_us, int for_scl)
+static int __wait(unsigned int bus, int timeout_us, int for_scl)
 {
 	int us;
 	int sda = software_i2c[bus]->get_sda(bus);
@@ -63,13 +63,13 @@
 }
 
 /* Waits the default DELAY_US to allow line state to stabilize. */
-static void wait(unsigned bus)
+static void wait(unsigned int bus)
 {
 	__wait(bus, DELAY_US, 0);
 }
 
 /* Waits until SCL goes high. Prints a contextual error message on timeout. */
-static int wait_for_scl(unsigned bus, const char *error_context)
+static int wait_for_scl(unsigned int bus, const char *error_context)
 {
 	if (!__wait(bus, TIMEOUT_US, 1)) {
 		printk(BIOS_ERR, "software_i2c(%d): ERROR: Clock stretching "
@@ -80,7 +80,7 @@
 	return 0;
 }
 
-static int start_cond(unsigned bus)
+static int start_cond(unsigned int bus)
 {
 	spew("software_i2c(%d): Sending start condition... ", bus);
 
@@ -112,7 +112,7 @@
 	return 0;
 }
 
-static int stop_cond(unsigned bus)
+static int stop_cond(unsigned int bus)
 {
 	spew("software_i2c(%d): Sending stop condition... ", bus);
 
@@ -141,7 +141,7 @@
 	return 0;
 }
 
-static int out_bit(unsigned bus, int bit)
+static int out_bit(unsigned int bus, int bit)
 {
 	spew("software_i2c(%d): Sending a %d bit... ", bus, bit);
 
@@ -174,7 +174,7 @@
 	return 0;
 }
 
-static int in_bit(unsigned bus)
+static int in_bit(unsigned int bus)
 {
 	int bit;
 
@@ -202,9 +202,9 @@
 }
 
 /* Write a byte to I2C bus. Return 0 if ack by the slave. */
-static int out_byte(unsigned bus, u8 byte)
+static int out_byte(unsigned int bus, u8 byte)
 {
-	unsigned bit;
+	unsigned int bit;
 	int nack, ret;
 
 	for (bit = 0; bit < 8; bit++)
@@ -220,7 +220,7 @@
 	return nack > 0 ? ERR_NACK : nack;
 }
 
-static int in_byte(unsigned bus, int ack)
+static int in_byte(unsigned int bus, int ack)
 {
 	u8 byte = 0;
 	int i, ret;
@@ -241,7 +241,7 @@
 	return byte;
 }
 
-int software_i2c_transfer(unsigned bus, struct i2c_msg *segments, int count)
+int software_i2c_transfer(unsigned int bus, struct i2c_msg *segments, int count)
 {
 	int i, ret;
 	struct i2c_msg *seg;
@@ -269,7 +269,7 @@
 	return 0;
 }
 
-void software_i2c_wedge_ack(unsigned bus, u8 chip)
+void software_i2c_wedge_ack(unsigned int bus, u8 chip)
 {
 	int i;
 
@@ -292,7 +292,7 @@
 		software_i2c[bus]->get_scl(bus));
 }
 
-void software_i2c_wedge_read(unsigned bus, u8 chip, u8 reg, int bits)
+void software_i2c_wedge_read(unsigned int bus, u8 chip, u8 reg, int bits)
 {
 	int i;
 
@@ -321,7 +321,7 @@
 		software_i2c[bus]->get_scl(bus));
 }
 
-void software_i2c_wedge_write(unsigned bus, u8 chip, u8 reg, int bits)
+void software_i2c_wedge_write(unsigned int bus, u8 chip, u8 reg, int bits)
 {
 	int i;