Daniel Lim Wee Soong has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32119
Change subject: cpu/ti/am335x: Fix checkpatch warnings ......................................................................
cpu/ti/am335x: Fix checkpatch warnings
Replace occurences of 'unsigned' with 'unsigned int' to fix
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
Signed-off-by: Daniel Lim Wee Soong weesoong.lim@gmail.com Change-Id: I94665e8fcb4719521d143774aa84f630b10ee68a --- M src/cpu/ti/am335x/gpio.c M src/cpu/ti/am335x/gpio.h 2 files changed, 11 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/32119/1
diff --git a/src/cpu/ti/am335x/gpio.c b/src/cpu/ti/am335x/gpio.c index e1c6967..2685839 100644 --- a/src/cpu/ti/am335x/gpio.c +++ b/src/cpu/ti/am335x/gpio.c @@ -18,9 +18,10 @@ #include <stdint.h> #include <stdlib.h>
-static struct am335x_gpio_regs *gpio_regs_and_bit(unsigned gpio, uint32_t *bit) +static struct am335x_gpio_regs *gpio_regs_and_bit(unsigned int gpio, + uint32_t *bit) { - unsigned bank = gpio / AM335X_GPIO_BITS_PER_BANK; + unsigned int bank = gpio / AM335X_GPIO_BITS_PER_BANK;
if (bank >= ARRAY_SIZE(am335x_gpio_banks)) { printk(BIOS_ERR, "Bad gpio index %d.\n", gpio); @@ -38,7 +39,7 @@ write32(&am335x_gpio_banks[i]->irqstatus_clr_0, 0xffffffff); }
-int gpio_direction_input(unsigned gpio) +int gpio_direction_input(unsigned int gpio) { uint32_t bit; struct am335x_gpio_regs *regs = gpio_regs_and_bit(gpio, &bit); @@ -49,7 +50,7 @@ return 0; }
-int gpio_direction_output(unsigned gpio, int value) +int gpio_direction_output(unsigned int gpio, int value) { uint32_t bit; struct am335x_gpio_regs *regs = gpio_regs_and_bit(gpio, &bit); @@ -64,7 +65,7 @@ return 0; }
-int gpio_get_value(unsigned gpio) +int gpio_get_value(unsigned int gpio) { uint32_t bit; struct am335x_gpio_regs *regs = gpio_regs_and_bit(gpio, &bit); @@ -74,7 +75,7 @@ return (read32(®s->datain) & bit) ? 1 : 0; }
-int gpio_set_value(unsigned gpio, int value) +int gpio_set_value(unsigned int gpio, int value) { uint32_t bit; struct am335x_gpio_regs *regs = gpio_regs_and_bit(gpio, &bit); diff --git a/src/cpu/ti/am335x/gpio.h b/src/cpu/ti/am335x/gpio.h index c04a00c..616c0af 100644 --- a/src/cpu/ti/am335x/gpio.h +++ b/src/cpu/ti/am335x/gpio.h @@ -62,9 +62,9 @@
void am335x_disable_gpio_irqs(void);
-int gpio_direction_input(unsigned gpio); -int gpio_direction_output(unsigned gpio, int value); -int gpio_get_value(unsigned gpio); -int gpio_set_value(unsigned gpio, int value); +int gpio_direction_input(unsigned int gpio); +int gpio_direction_output(unsigned int gpio, int value); +int gpio_get_value(unsigned int gpio); +int gpio_set_value(unsigned int gpio, int value);
#endif /* __CPU_TI_AM335X_CLOCK_H__ */
ron minnich has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32119 )
Change subject: cpu/ti/am335x: Fix checkpatch warnings ......................................................................
Patch Set 1: Code-Review+2
Thank you for your fix, and welcome to coreboot!
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32119 )
Change subject: cpu/ti/am335x: Fix checkpatch warnings ......................................................................
cpu/ti/am335x: Fix checkpatch warnings
Replace occurences of 'unsigned' with 'unsigned int' to fix
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
Signed-off-by: Daniel Lim Wee Soong weesoong.lim@gmail.com Change-Id: I94665e8fcb4719521d143774aa84f630b10ee68a Reviewed-on: https://review.coreboot.org/c/coreboot/+/32119 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: ron minnich rminnich@gmail.com --- M src/cpu/ti/am335x/gpio.c M src/cpu/ti/am335x/gpio.h 2 files changed, 11 insertions(+), 10 deletions(-)
Approvals: build bot (Jenkins): Verified ron minnich: Looks good to me, approved
diff --git a/src/cpu/ti/am335x/gpio.c b/src/cpu/ti/am335x/gpio.c index e1c6967..2685839 100644 --- a/src/cpu/ti/am335x/gpio.c +++ b/src/cpu/ti/am335x/gpio.c @@ -18,9 +18,10 @@ #include <stdint.h> #include <stdlib.h>
-static struct am335x_gpio_regs *gpio_regs_and_bit(unsigned gpio, uint32_t *bit) +static struct am335x_gpio_regs *gpio_regs_and_bit(unsigned int gpio, + uint32_t *bit) { - unsigned bank = gpio / AM335X_GPIO_BITS_PER_BANK; + unsigned int bank = gpio / AM335X_GPIO_BITS_PER_BANK;
if (bank >= ARRAY_SIZE(am335x_gpio_banks)) { printk(BIOS_ERR, "Bad gpio index %d.\n", gpio); @@ -38,7 +39,7 @@ write32(&am335x_gpio_banks[i]->irqstatus_clr_0, 0xffffffff); }
-int gpio_direction_input(unsigned gpio) +int gpio_direction_input(unsigned int gpio) { uint32_t bit; struct am335x_gpio_regs *regs = gpio_regs_and_bit(gpio, &bit); @@ -49,7 +50,7 @@ return 0; }
-int gpio_direction_output(unsigned gpio, int value) +int gpio_direction_output(unsigned int gpio, int value) { uint32_t bit; struct am335x_gpio_regs *regs = gpio_regs_and_bit(gpio, &bit); @@ -64,7 +65,7 @@ return 0; }
-int gpio_get_value(unsigned gpio) +int gpio_get_value(unsigned int gpio) { uint32_t bit; struct am335x_gpio_regs *regs = gpio_regs_and_bit(gpio, &bit); @@ -74,7 +75,7 @@ return (read32(®s->datain) & bit) ? 1 : 0; }
-int gpio_set_value(unsigned gpio, int value) +int gpio_set_value(unsigned int gpio, int value) { uint32_t bit; struct am335x_gpio_regs *regs = gpio_regs_and_bit(gpio, &bit); diff --git a/src/cpu/ti/am335x/gpio.h b/src/cpu/ti/am335x/gpio.h index c04a00c..616c0af 100644 --- a/src/cpu/ti/am335x/gpio.h +++ b/src/cpu/ti/am335x/gpio.h @@ -62,9 +62,9 @@
void am335x_disable_gpio_irqs(void);
-int gpio_direction_input(unsigned gpio); -int gpio_direction_output(unsigned gpio, int value); -int gpio_get_value(unsigned gpio); -int gpio_set_value(unsigned gpio, int value); +int gpio_direction_input(unsigned int gpio); +int gpio_direction_output(unsigned int gpio, int value); +int gpio_get_value(unsigned int gpio); +int gpio_set_value(unsigned int gpio, int value);
#endif /* __CPU_TI_AM335X_CLOCK_H__ */