Linux-GPIO Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/3] gpio: gpio-intel-mid.c: changed every 'unsigned' to 'unsigned int'
@ 2020-07-21 14:49 Abanoub Sameh
  2020-07-21 14:49 ` [PATCH 2/3] gpio: gpio-intel-mid.c: fixed alignment of a block comment Abanoub Sameh
  2020-07-21 14:49 ` [PATCH 3/3] gpio: gpio-intel-mid.c: fixed a coding style issue Abanoub Sameh
  0 siblings, 2 replies; 3+ messages in thread
From: Abanoub Sameh @ 2020-07-21 14:49 UTC (permalink / raw)
  To: andy.shevchenko
  Cc: linus.walleij, bgolaszewski, linux-gpio, linux-kernel, Abanoub Sameh

Changed 'unsigned' to 'unsigned int'.
This makes the code more uniform, and compliant with the kernel coding style.

Signed-off-by: Abanoub Sameh <abanoubsameh@protonmail.com>
---
 drivers/gpio/gpio-intel-mid.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c
index 86a10c808ef6..6487acab104c 100644
--- a/drivers/gpio/gpio-intel-mid.c
+++ b/drivers/gpio/gpio-intel-mid.c
@@ -64,27 +64,27 @@ struct intel_mid_gpio {
 	struct pci_dev			*pdev;
 };
 
-static void __iomem *gpio_reg(struct gpio_chip *chip, unsigned offset,
+static void __iomem *gpio_reg(struct gpio_chip *chip, unsigned int offset,
 			      enum GPIO_REG reg_type)
 {
 	struct intel_mid_gpio *priv = gpiochip_get_data(chip);
-	unsigned nreg = chip->ngpio / 32;
+	unsigned int nreg = chip->ngpio / 32;
 	u8 reg = offset / 32;
 
 	return priv->reg_base + reg_type * nreg * 4 + reg * 4;
 }
 
-static void __iomem *gpio_reg_2bit(struct gpio_chip *chip, unsigned offset,
+static void __iomem *gpio_reg_2bit(struct gpio_chip *chip, unsigned int offset,
 				   enum GPIO_REG reg_type)
 {
 	struct intel_mid_gpio *priv = gpiochip_get_data(chip);
-	unsigned nreg = chip->ngpio / 32;
+	unsigned int nreg = chip->ngpio / 32;
 	u8 reg = offset / 16;
 
 	return priv->reg_base + reg_type * nreg * 4 + reg * 4;
 }
 
-static int intel_gpio_request(struct gpio_chip *chip, unsigned offset)
+static int intel_gpio_request(struct gpio_chip *chip, unsigned int offset)
 {
 	void __iomem *gafr = gpio_reg_2bit(chip, offset, GAFR);
 	u32 value = readl(gafr);
@@ -97,14 +97,14 @@ static int intel_gpio_request(struct gpio_chip *chip, unsigned offset)
 	return 0;
 }
 
-static int intel_gpio_get(struct gpio_chip *chip, unsigned offset)
+static int intel_gpio_get(struct gpio_chip *chip, unsigned int offset)
 {
 	void __iomem *gplr = gpio_reg(chip, offset, GPLR);
 
 	return !!(readl(gplr) & BIT(offset % 32));
 }
 
-static void intel_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+static void intel_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
 {
 	void __iomem *gpsr, *gpcr;
 
@@ -117,7 +117,7 @@ static void intel_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
 	}
 }
 
-static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
+static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
 {
 	struct intel_mid_gpio *priv = gpiochip_get_data(chip);
 	void __iomem *gpdr = gpio_reg(chip, offset, GPDR);
@@ -140,7 +140,7 @@ static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
 }
 
 static int intel_gpio_direction_output(struct gpio_chip *chip,
-			unsigned offset, int value)
+			unsigned int offset, int value)
 {
 	struct intel_mid_gpio *priv = gpiochip_get_data(chip);
 	void __iomem *gpdr = gpio_reg(chip, offset, GPDR);
@@ -163,7 +163,7 @@ static int intel_gpio_direction_output(struct gpio_chip *chip,
 	return 0;
 }
 
-static int intel_mid_irq_type(struct irq_data *d, unsigned type)
+static int intel_mid_irq_type(struct irq_data *d, unsigned int type)
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct intel_mid_gpio *priv = gpiochip_get_data(gc);
@@ -297,7 +297,7 @@ static int intel_mid_irq_init_hw(struct gpio_chip *chip)
 {
 	struct intel_mid_gpio *priv = gpiochip_get_data(chip);
 	void __iomem *reg;
-	unsigned base;
+	unsigned int base;
 
 	for (base = 0; base < priv->chip.ngpio; base += 32) {
 		/* Clear the rising-edge detect register */
-- 
2.28.0.rc0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/3] gpio: gpio-intel-mid.c: fixed alignment of a block comment
  2020-07-21 14:49 [PATCH 1/3] gpio: gpio-intel-mid.c: changed every 'unsigned' to 'unsigned int' Abanoub Sameh
@ 2020-07-21 14:49 ` Abanoub Sameh
  2020-07-21 14:49 ` [PATCH 3/3] gpio: gpio-intel-mid.c: fixed a coding style issue Abanoub Sameh
  1 sibling, 0 replies; 3+ messages in thread
From: Abanoub Sameh @ 2020-07-21 14:49 UTC (permalink / raw)
  To: andy.shevchenko
  Cc: linus.walleij, bgolaszewski, linux-gpio, linux-kernel, Abanoub Sameh

A small to the coding style of a comment to make it compliant with the coding style.

Signed-off-by: Abanoub Sameh <abanoubsameh@protonmail.com>
---
 drivers/gpio/gpio-intel-mid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c
index 6487acab104c..a9cef06b813b 100644
--- a/drivers/gpio/gpio-intel-mid.c
+++ b/drivers/gpio/gpio-intel-mid.c
@@ -38,7 +38,7 @@
  * reg_addr = reg_base + GPDR * nreg * 4 + reg * 4;
  *
  * so the bit of reg_addr is to control pin offset's GPDR feature
-*/
+ */
 
 enum GPIO_REG {
 	GPLR = 0,	/* pin level read-only */
-- 
2.28.0.rc0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 3/3] gpio: gpio-intel-mid.c: fixed a coding style issue
  2020-07-21 14:49 [PATCH 1/3] gpio: gpio-intel-mid.c: changed every 'unsigned' to 'unsigned int' Abanoub Sameh
  2020-07-21 14:49 ` [PATCH 2/3] gpio: gpio-intel-mid.c: fixed alignment of a block comment Abanoub Sameh
@ 2020-07-21 14:49 ` Abanoub Sameh
  1 sibling, 0 replies; 3+ messages in thread
From: Abanoub Sameh @ 2020-07-21 14:49 UTC (permalink / raw)
  To: andy.shevchenko
  Cc: linus.walleij, bgolaszewski, linux-gpio, linux-kernel, Abanoub Sameh

Added an empty line after a declaration to fix a coding style issue.

Signed-off-by: Abanoub Sameh <abanoubsameh@protonmail.com>
---
 drivers/gpio/gpio-intel-mid.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c
index a9cef06b813b..a609964645c1 100644
--- a/drivers/gpio/gpio-intel-mid.c
+++ b/drivers/gpio/gpio-intel-mid.c
@@ -317,6 +317,7 @@ static int intel_mid_irq_init_hw(struct gpio_chip *chip)
 static int __maybe_unused intel_gpio_runtime_idle(struct device *dev)
 {
 	int err = pm_schedule_suspend(dev, 500);
+
 	return err ?: -EBUSY;
 }
 
-- 
2.28.0.rc0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 14:49 [PATCH 1/3] gpio: gpio-intel-mid.c: changed every 'unsigned' to 'unsigned int' Abanoub Sameh
2020-07-21 14:49 ` [PATCH 2/3] gpio: gpio-intel-mid.c: fixed alignment of a block comment Abanoub Sameh
2020-07-21 14:49 ` [PATCH 3/3] gpio: gpio-intel-mid.c: fixed a coding style issue Abanoub Sameh

Linux-GPIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-gpio/0 linux-gpio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-gpio linux-gpio/ https://lore.kernel.org/linux-gpio \
		linux-gpio@vger.kernel.org
	public-inbox-index linux-gpio

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-gpio


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git