* [PATCH 1/4] gpio: gpio-msic.c: changed every 'unsigned' to 'unsigned int'
@ 2020-07-21 14:50 Abanoub Sameh
2020-07-21 14:50 ` [PATCH 2/4] gpio: gpio-msic.c: fixed style of a block comment Abanoub Sameh
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Abanoub Sameh @ 2020-07-21 14:50 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-msic.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c
index 7e3c96e4ab2c..ea5ff2c84a26 100644
--- a/drivers/gpio/gpio-msic.c
+++ b/drivers/gpio/gpio-msic.c
@@ -43,9 +43,9 @@ struct msic_gpio {
struct mutex buslock;
struct gpio_chip chip;
int irq;
- unsigned irq_base;
+ unsigned int irq_base;
unsigned long trig_change_mask;
- unsigned trig_type;
+ unsigned int trig_type;
};
/*
@@ -58,7 +58,7 @@ struct msic_gpio {
* GPIO1HV0..GPIO1HV3: high voltage, bank 1, gpio_base + 20
*/
-static int msic_gpio_to_ireg(unsigned offset)
+static int msic_gpio_to_ireg(unsigned int offset)
{
if (offset >= MSIC_NUM_GPIO)
return -EINVAL;
@@ -73,7 +73,7 @@ static int msic_gpio_to_ireg(unsigned offset)
return INTEL_MSIC_GPIO1HV0CTLI - offset + 20;
}
-static int msic_gpio_to_oreg(unsigned offset)
+static int msic_gpio_to_oreg(unsigned int offset)
{
if (offset >= MSIC_NUM_GPIO)
return -EINVAL;
@@ -88,7 +88,7 @@ static int msic_gpio_to_oreg(unsigned offset)
return INTEL_MSIC_GPIO1HV0CTLO - offset + 20;
}
-static int msic_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
+static int msic_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
{
int reg;
@@ -100,10 +100,10 @@ static int msic_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
}
static int msic_gpio_direction_output(struct gpio_chip *chip,
- unsigned offset, int value)
+ unsigned int offset, int value)
{
int reg;
- unsigned mask;
+ unsigned int mask;
value = (!!value) | MSIC_GPIO_DIR_OUT;
mask = MSIC_GPIO_DIR_MASK | MSIC_GPIO_DOUT_MASK;
@@ -115,7 +115,7 @@ static int msic_gpio_direction_output(struct gpio_chip *chip,
return intel_msic_reg_update(reg, value, mask);
}
-static int msic_gpio_get(struct gpio_chip *chip, unsigned offset)
+static int msic_gpio_get(struct gpio_chip *chip, unsigned int offset)
{
u8 r;
int ret;
@@ -132,7 +132,7 @@ static int msic_gpio_get(struct gpio_chip *chip, unsigned offset)
return !!(r & MSIC_GPIO_DIN_MASK);
}
-static void msic_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+static void msic_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
{
int reg;
@@ -148,7 +148,7 @@ static void msic_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
* irq_desc->lock held. We can not access the scu bus here, so we
* store the change and update in the bus_sync_unlock() function below
*/
-static int msic_irq_type(struct irq_data *data, unsigned type)
+static int msic_irq_type(struct irq_data *data, unsigned int type)
{
struct msic_gpio *mg = irq_data_get_irq_chip_data(data);
u32 gpio = data->irq - mg->irq_base;
@@ -163,7 +163,7 @@ static int msic_irq_type(struct irq_data *data, unsigned type)
return 0;
}
-static int msic_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
+static int msic_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
{
struct msic_gpio *mg = gpiochip_get_data(chip);
return mg->irq_base + offset;
--
2.28.0.rc0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/4] gpio: gpio-msic.c: fixed style of a block comment
2020-07-21 14:50 [PATCH 1/4] gpio: gpio-msic.c: changed every 'unsigned' to 'unsigned int' Abanoub Sameh
@ 2020-07-21 14:50 ` Abanoub Sameh
2020-07-21 14:50 ` [PATCH 3/4] gpio: gpio-msic.c: fixed coding style issues Abanoub Sameh
2020-07-21 14:50 ` [PATCH 4/4] gpio: gpio-msic.c: fixed a coding style error Abanoub Sameh
2 siblings, 0 replies; 4+ messages in thread
From: Abanoub Sameh @ 2020-07-21 14:50 UTC (permalink / raw)
To: andy.shevchenko
Cc: linus.walleij, bgolaszewski, linux-gpio, linux-kernel, Abanoub Sameh
Added asterisk to each line of a block and fixed and moved the ending to
the next line.
Signed-off-by: Abanoub Sameh <abanoubsameh@protonmail.com>
---
drivers/gpio/gpio-msic.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c
index ea5ff2c84a26..0bef1a5a9b70 100644
--- a/drivers/gpio/gpio-msic.c
+++ b/drivers/gpio/gpio-msic.c
@@ -183,8 +183,9 @@ static void msic_bus_sync_unlock(struct irq_data *data)
u8 trig = 0;
/* We can only get one change at a time as the buslock covers the
- entire transaction. The irq_desc->lock is dropped before we are
- called but that is fine */
+ * entire transaction. The irq_desc->lock is dropped before we are
+ * called but that is fine
+ */
if (mg->trig_change_mask) {
offset = __ffs(mg->trig_change_mask);
--
2.28.0.rc0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/4] gpio: gpio-msic.c: fixed coding style issues
2020-07-21 14:50 [PATCH 1/4] gpio: gpio-msic.c: changed every 'unsigned' to 'unsigned int' Abanoub Sameh
2020-07-21 14:50 ` [PATCH 2/4] gpio: gpio-msic.c: fixed style of a block comment Abanoub Sameh
@ 2020-07-21 14:50 ` Abanoub Sameh
2020-07-21 14:50 ` [PATCH 4/4] gpio: gpio-msic.c: fixed a coding style error Abanoub Sameh
2 siblings, 0 replies; 4+ messages in thread
From: Abanoub Sameh @ 2020-07-21 14:50 UTC (permalink / raw)
To: andy.shevchenko
Cc: linus.walleij, bgolaszewski, linux-gpio, linux-kernel, Abanoub Sameh
Added a lined between declarations and other statements according to the
kenel coding style.
Signed-off-by: Abanoub Sameh <abanoubsameh@protonmail.com>
---
drivers/gpio/gpio-msic.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c
index 0bef1a5a9b70..84e00e0ab953 100644
--- a/drivers/gpio/gpio-msic.c
+++ b/drivers/gpio/gpio-msic.c
@@ -166,12 +166,14 @@ static int msic_irq_type(struct irq_data *data, unsigned int type)
static int msic_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
{
struct msic_gpio *mg = gpiochip_get_data(chip);
+
return mg->irq_base + offset;
}
static void msic_bus_lock(struct irq_data *data)
{
struct msic_gpio *mg = irq_data_get_irq_chip_data(data);
+
mutex_lock(&mg->buslock);
}
--
2.28.0.rc0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 4/4] gpio: gpio-msic.c: fixed a coding style error
2020-07-21 14:50 [PATCH 1/4] gpio: gpio-msic.c: changed every 'unsigned' to 'unsigned int' Abanoub Sameh
2020-07-21 14:50 ` [PATCH 2/4] gpio: gpio-msic.c: fixed style of a block comment Abanoub Sameh
2020-07-21 14:50 ` [PATCH 3/4] gpio: gpio-msic.c: fixed coding style issues Abanoub Sameh
@ 2020-07-21 14:50 ` Abanoub Sameh
2 siblings, 0 replies; 4+ messages in thread
From: Abanoub Sameh @ 2020-07-21 14:50 UTC (permalink / raw)
To: andy.shevchenko
Cc: linus.walleij, bgolaszewski, linux-gpio, linux-kernel, Abanoub Sameh
Removed space before comma to fix coding style error.
Signed-off-by: Abanoub Sameh <abanoubsameh@protonmail.com>
---
drivers/gpio/gpio-msic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c
index 84e00e0ab953..37664e7b3ddd 100644
--- a/drivers/gpio/gpio-msic.c
+++ b/drivers/gpio/gpio-msic.c
@@ -140,7 +140,7 @@ static void msic_gpio_set(struct gpio_chip *chip, unsigned int offset, int value
if (reg < 0)
return;
- intel_msic_reg_update(reg, !!value , MSIC_GPIO_DOUT_MASK);
+ intel_msic_reg_update(reg, !!value, MSIC_GPIO_DOUT_MASK);
}
/*
--
2.28.0.rc0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-07-21 14:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 14:50 [PATCH 1/4] gpio: gpio-msic.c: changed every 'unsigned' to 'unsigned int' Abanoub Sameh
2020-07-21 14:50 ` [PATCH 2/4] gpio: gpio-msic.c: fixed style of a block comment Abanoub Sameh
2020-07-21 14:50 ` [PATCH 3/4] gpio: gpio-msic.c: fixed coding style issues Abanoub Sameh
2020-07-21 14:50 ` [PATCH 4/4] gpio: gpio-msic.c: fixed a coding style error Abanoub Sameh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).