Skip to contentSkip to conversation

pinctrl: samsung: Use unsigned int for number of controller IO mem resources

PATCH In review Krzysztof Kozlowski 2 participants 4 messages Jun 15, 2017 – Jun 20, 2017

Subsystems (4)
lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

PATCH 1/2 pinctrl: samsung: Use unsigned int for number of controller IO mem resources

Number of IO memory resources cannot be negative obviously and the driver depends silently on this (by iterating from 0 to nr_ext_resources+1). Make this requirement explicit.

---
 drivers/pinctrl/samsung/pinctrl-samsung.c | 2 +-
 drivers/pinctrl/samsung/pinctrl-samsung.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/samsung/pinctrl-samsung.c +1 -1
index 86c98c1dec3a..c7ac2b944f57 100644
@@ -960,7 +960,7 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d,
 	struct samsung_pin_bank *bank;
 	struct resource *res;
 	void __iomem *virt_base[SAMSUNG_PINCTRL_NUM_RESOURCES];
-	int i;
+	unsigned int i;
 
 	id = of_alias_get_id(node, "pinctrl");
 	if (id < 0) {
drivers/pinctrl/samsung/pinctrl-samsung.h +1 -1
index 15b26c786b1e..49a05f4fc37d 100644
@@ -231,7 +231,7 @@ struct samsung_retention_data {
 struct samsung_pin_ctrl {
 	const struct samsung_pin_bank_data *pin_banks;
 	u32		nr_banks;
-	int		nr_ext_resources;
+	unsigned int	nr_ext_resources;
 	const struct samsung_retention_data *retention_data;
 
 	int		(*eint_gpio_init)(struct samsung_pinctrl_drv_data *);
Signature · 1 line
2.9.3
author maintainer
#1 lore raw

PATCH 2/2 pinctrl: samsung: Consistently use unsigned instead of u32 for nr_banks

Unlike for other countable members, the driver used u32 for number of banks (nr_banks). There is no specific need for using fixed-width integer in this particular place. Make it consistent.

---
 drivers/pinctrl/samsung/pinctrl-samsung.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/samsung/pinctrl-samsung.h +2 -2
index 49a05f4fc37d..9af07af6cad6 100644
@@ -230,7 +230,7 @@ struct samsung_retention_data {
  */
 struct samsung_pin_ctrl {
 	const struct samsung_pin_bank_data *pin_banks;
-	u32		nr_banks;
+	unsigned int	nr_banks;
 	unsigned int	nr_ext_resources;
 	const struct samsung_retention_data *retention_data;
 
@@ -275,7 +275,7 @@ struct samsung_pinctrl_drv_data {
 	unsigned int			nr_functions;
 
 	struct samsung_pin_bank		*pin_banks;
-	u32				nr_banks;
+	unsigned int			nr_banks;
 	unsigned int			pin_base;
 	unsigned int			nr_pins;
 
Signature · 1 line
2.9.3
maintainer Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] pinctrl: samsung: Consistently use unsigned instead of u32 for nr_banks

Quoted 5 lines · Krzysztof Kozlowski

Unlike for other countable members, the driver used u32 for number of banks (nr_banks). There is no specific need for using fixed-width integer in this particular place. Make it consistent.

Signature · 2 lines
Regards,
Sylwester