[coreboot-gerrit] Change in coreboot[master]: arch/x86: Fix prefer errors detected by checkpatch
Lee Leahy (Code Review)
gerrit at coreboot.org
Fri Mar 17 03:18:07 CET 2017
Lee Leahy has submitted this change and it was merged. ( https://review.coreboot.org/18863 )
Change subject: arch/x86: Fix prefer errors detected by checkpatch
......................................................................
arch/x86: Fix prefer errors detected by checkpatch
Fix the following warnings detected by checkpatch.pl:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: plain inline is preferred over __inline__
TEST=Build and run on Galileo Gen2
Change-Id: I8ba98dfe04481a7ccf4f3b910660178b7e22a4a7
Signed-off-by: Lee Leahy <Leroy.P.Leahy at intel.com>
Reviewed-on: https://review.coreboot.org/18863
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin at chromium.org>
---
M src/arch/x86/acpi_device.c
M src/arch/x86/include/arch/acpi_device.h
M src/arch/x86/include/arch/cpu.h
M src/arch/x86/include/arch/io.h
M src/arch/x86/include/arch/pci_io_cfg.h
M src/arch/x86/include/arch/smp/atomic.h
M src/arch/x86/mpspec.c
7 files changed, 38 insertions(+), 37 deletions(-)
Approvals:
Aaron Durbin: Looks good to me, approved
build bot (Jenkins): Verified
diff --git a/src/arch/x86/acpi_device.c b/src/arch/x86/acpi_device.c
index 42305a6..8ea6f5e 100644
--- a/src/arch/x86/acpi_device.c
+++ b/src/arch/x86/acpi_device.c
@@ -492,12 +492,12 @@
/* PowerResource() with Enable and/or Reset control */
void acpi_device_add_power_res(
- struct acpi_gpio *reset, unsigned reset_delay_ms,
- struct acpi_gpio *enable, unsigned enable_delay_ms)
+ struct acpi_gpio *reset, unsigned int reset_delay_ms,
+ struct acpi_gpio *enable, unsigned int enable_delay_ms)
{
const char *power_res_dev_states[] = { "_PR0", "_PR3" };
- unsigned reset_gpio = reset->pins[0];
- unsigned enable_gpio = enable->pins[0];
+ unsigned int reset_gpio = reset->pins[0];
+ unsigned int enable_gpio = enable->pins[0];
if (!reset_gpio && !enable_gpio)
return;
diff --git a/src/arch/x86/include/arch/acpi_device.h b/src/arch/x86/include/arch/acpi_device.h
index 29e0e8d..f904cc6 100644
--- a/src/arch/x86/include/arch/acpi_device.h
+++ b/src/arch/x86/include/arch/acpi_device.h
@@ -288,8 +288,8 @@
* GPIO is optional, but at least one must be provided.
*/
void acpi_device_add_power_res(
- struct acpi_gpio *reset, unsigned reset_delay_ms,
- struct acpi_gpio *enable, unsigned enable_delay_ms);
+ struct acpi_gpio *reset, unsigned int reset_delay_ms,
+ struct acpi_gpio *enable, unsigned int enable_delay_ms);
/*
* Writing Device Properties objects via _DSD
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h
index 936dcf4..e59eb32 100644
--- a/src/arch/x86/include/arch/cpu.h
+++ b/src/arch/x86/include/arch/cpu.h
@@ -69,7 +69,7 @@
/*
* Generic Extended CPUID function
*/
-static inline struct cpuid_result cpuid_ext(int op, unsigned ecx)
+static inline struct cpuid_result cpuid_ext(int op, unsigned int ecx)
{
struct cpuid_result result;
asm volatile(
@@ -171,8 +171,8 @@
struct device;
struct cpu_device_id {
- unsigned vendor;
- unsigned device;
+ unsigned int vendor;
+ unsigned int device;
};
struct cpu_driver {
diff --git a/src/arch/x86/include/arch/io.h b/src/arch/x86/include/arch/io.h
index 0edddb0..f16c091 100644
--- a/src/arch/x86/include/arch/io.h
+++ b/src/arch/x86/include/arch/io.h
@@ -292,7 +292,7 @@
}
static inline __attribute__((always_inline))
-void pci_write_config32(pci_devfn_t dev, unsigned where, uint32_t value)
+void pci_write_config32(pci_devfn_t dev, unsigned int where, uint32_t value)
{
if (IS_ENABLED(CONFIG_MMCONF_SUPPORT))
pci_mmio_write_config32(dev, where, value);
@@ -301,7 +301,7 @@
}
#define PCI_DEV_INVALID (0xffffffffU)
-static inline pci_devfn_t pci_io_locate_device(unsigned pci_id, pci_devfn_t dev)
+static inline pci_devfn_t pci_io_locate_device(unsigned int pci_id, pci_devfn_t dev)
{
for (; dev <= PCI_DEV(255, 31, 7); dev += PCI_DEV(0, 0, 1)) {
unsigned int id;
@@ -312,7 +312,7 @@
return PCI_DEV_INVALID;
}
-static inline pci_devfn_t pci_locate_device(unsigned pci_id, pci_devfn_t dev)
+static inline pci_devfn_t pci_locate_device(unsigned int pci_id, pci_devfn_t dev)
{
for (; dev <= PCI_DEV(255, 31, 7); dev += PCI_DEV(0, 0, 1)) {
unsigned int id;
@@ -323,7 +323,8 @@
return PCI_DEV_INVALID;
}
-static inline pci_devfn_t pci_locate_device_on_bus(unsigned pci_id, unsigned bus)
+static inline pci_devfn_t pci_locate_device_on_bus(unsigned int pci_id,
+ unsigned int bus)
{
pci_devfn_t dev, last;
@@ -342,14 +343,14 @@
/* Generic functions for pnp devices */
static inline __attribute__((always_inline)) void pnp_write_config(pnp_devfn_t dev, uint8_t reg, uint8_t value)
{
- unsigned port = dev >> 8;
+ unsigned int port = dev >> 8;
outb(reg, port);
outb(value, port + 1);
}
static inline __attribute__((always_inline)) uint8_t pnp_read_config(pnp_devfn_t dev, uint8_t reg)
{
- unsigned port = dev >> 8;
+ unsigned int port = dev >> 8;
outb(reg, port);
return inb(port + 1);
}
@@ -357,7 +358,7 @@
static inline __attribute__((always_inline))
void pnp_set_logical_device(pnp_devfn_t dev)
{
- unsigned device = dev & 0xff;
+ unsigned int device = dev & 0xff;
pnp_write_config(dev, 0x07, device);
}
@@ -374,26 +375,26 @@
}
static inline __attribute__((always_inline))
-void pnp_set_iobase(pnp_devfn_t dev, unsigned index, unsigned iobase)
+void pnp_set_iobase(pnp_devfn_t dev, unsigned int index, unsigned int iobase)
{
pnp_write_config(dev, index + 0, (iobase >> 8) & 0xff);
pnp_write_config(dev, index + 1, iobase & 0xff);
}
static inline __attribute__((always_inline))
-uint16_t pnp_read_iobase(pnp_devfn_t dev, unsigned index)
+uint16_t pnp_read_iobase(pnp_devfn_t dev, unsigned int index)
{
return ((uint16_t)(pnp_read_config(dev, index)) << 8) | pnp_read_config(dev, index + 1);
}
static inline __attribute__((always_inline))
-void pnp_set_irq(pnp_devfn_t dev, unsigned index, unsigned irq)
+void pnp_set_irq(pnp_devfn_t dev, unsigned int index, unsigned int irq)
{
pnp_write_config(dev, index, irq);
}
static inline __attribute__((always_inline))
-void pnp_set_drq(pnp_devfn_t dev, unsigned index, unsigned drq)
+void pnp_set_drq(pnp_devfn_t dev, unsigned int index, unsigned int drq)
{
pnp_write_config(dev, index, drq & 0xff);
}
diff --git a/src/arch/x86/include/arch/pci_io_cfg.h b/src/arch/x86/include/arch/pci_io_cfg.h
index 4346285..8802cc0 100644
--- a/src/arch/x86/include/arch/pci_io_cfg.h
+++ b/src/arch/x86/include/arch/pci_io_cfg.h
@@ -17,9 +17,9 @@
#include <arch/io.h>
static inline __attribute__((always_inline))
-uint8_t pci_io_read_config8(pci_devfn_t dev, unsigned where)
+uint8_t pci_io_read_config8(pci_devfn_t dev, unsigned int where)
{
- unsigned addr;
+ unsigned int addr;
#if !CONFIG_PCI_IO_CFG_EXT
addr = (dev>>4) | where;
#else
@@ -30,9 +30,9 @@
}
static inline __attribute__((always_inline))
-uint16_t pci_io_read_config16(pci_devfn_t dev, unsigned where)
+uint16_t pci_io_read_config16(pci_devfn_t dev, unsigned int where)
{
- unsigned addr;
+ unsigned int addr;
#if !CONFIG_PCI_IO_CFG_EXT
addr = (dev>>4) | where;
#else
@@ -43,9 +43,9 @@
}
static inline __attribute__((always_inline))
-uint32_t pci_io_read_config32(pci_devfn_t dev, unsigned where)
+uint32_t pci_io_read_config32(pci_devfn_t dev, unsigned int where)
{
- unsigned addr;
+ unsigned int addr;
#if !CONFIG_PCI_IO_CFG_EXT
addr = (dev>>4) | where;
#else
@@ -56,9 +56,9 @@
}
static inline __attribute__((always_inline))
-void pci_io_write_config8(pci_devfn_t dev, unsigned where, uint8_t value)
+void pci_io_write_config8(pci_devfn_t dev, unsigned int where, uint8_t value)
{
- unsigned addr;
+ unsigned int addr;
#if !CONFIG_PCI_IO_CFG_EXT
addr = (dev>>4) | where;
#else
@@ -69,9 +69,9 @@
}
static inline __attribute__((always_inline))
-void pci_io_write_config16(pci_devfn_t dev, unsigned where, uint16_t value)
+void pci_io_write_config16(pci_devfn_t dev, unsigned int where, uint16_t value)
{
- unsigned addr;
+ unsigned int addr;
#if !CONFIG_PCI_IO_CFG_EXT
addr = (dev>>4) | where;
#else
@@ -82,9 +82,9 @@
}
static inline __attribute__((always_inline))
-void pci_io_write_config32(pci_devfn_t dev, unsigned where, uint32_t value)
+void pci_io_write_config32(pci_devfn_t dev, unsigned int where, uint32_t value)
{
- unsigned addr;
+ unsigned int addr;
#if !CONFIG_PCI_IO_CFG_EXT
addr = (dev>>4) | where;
#else
diff --git a/src/arch/x86/include/arch/smp/atomic.h b/src/arch/x86/include/arch/smp/atomic.h
index 258c329..1ca165e 100644
--- a/src/arch/x86/include/arch/smp/atomic.h
+++ b/src/arch/x86/include/arch/smp/atomic.h
@@ -55,7 +55,7 @@
* Atomically increments v by 1. Note that the guaranteed
* useful range of an atomic_t is only 24 bits.
*/
-static __inline__ __attribute__((always_inline)) void atomic_inc(atomic_t *v)
+static inline __attribute__((always_inline)) void atomic_inc(atomic_t *v)
{
__asm__ __volatile__(
"lock ; incl %0"
@@ -70,7 +70,7 @@
* Atomically decrements v by 1. Note that the guaranteed
* useful range of an atomic_t is only 24 bits.
*/
-static __inline__ __attribute__((always_inline)) void atomic_dec(atomic_t *v)
+static inline __attribute__((always_inline)) void atomic_dec(atomic_t *v)
{
__asm__ __volatile__(
"lock ; decl %0"
diff --git a/src/arch/x86/mpspec.c b/src/arch/x86/mpspec.c
index d1a2da2..b0d563a 100644
--- a/src/arch/x86/mpspec.c
+++ b/src/arch/x86/mpspec.c
@@ -157,9 +157,9 @@
{
int boot_apic_id;
int order_id;
- unsigned apic_version;
- unsigned cpu_features;
- unsigned cpu_feature_flags;
+ unsigned int apic_version;
+ unsigned int cpu_features;
+ unsigned int cpu_feature_flags;
struct cpuid_result result;
struct device *cpu;
--
To view, visit https://review.coreboot.org/18863
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8ba98dfe04481a7ccf4f3b910660178b7e22a4a7
Gerrit-PatchSet: 2
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Lee Leahy <leroy.p.leahy at intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Lee Leahy <leroy.p.leahy at intel.com>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi at google.com>
Gerrit-Reviewer: build bot (Jenkins)
More information about the coreboot-gerrit
mailing list