2020-06-30 13:53:27

by Lee Jones

[permalink] [raw]
Subject: [PATCH 00/10] Clean GPIO of W=1 warnings

This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.

Lee Jones (10):
gpio: gpiolib-of: Provide documentation for of_gpio_spi_cs_get_count()
gpio: gpio-altera: Add missing kerneldoc entry and demote comment
gpio: gpio-ml-ioh: Fix missing ':' in 'struct ioh_gpio_reg_data
gpio: gpio-pmic-eic-sprd: Fix incorrectly named property 'map'
gpio: gpio-sama5d2-piobu: Demote all kerneldoc headers to basic
comment blocks
gpio: gpio-syscon: Fix formatting issues which confuse kerneldoc
gpio: gpio-it87: Fix formatting issues which confuse kerneldoc
gpio: gpio-mlxbf: Tell the compiler that ACPI functions may not be
used
gpio: gpio-mlxbf2: Tell the compiler that ACPI functions may not be
use
gpio: gpio-mlxbf2.c: Provide __releases() annotation to stop confusing
Sparse

drivers/gpio/gpio-altera.c | 3 ++-
drivers/gpio/gpio-it87.c | 14 +++++++-------
drivers/gpio/gpio-ml-ioh.c | 2 +-
drivers/gpio/gpio-mlxbf.c | 2 +-
drivers/gpio/gpio-mlxbf2.c | 4 +++-
drivers/gpio/gpio-pmic-eic-sprd.c | 2 +-
drivers/gpio/gpio-sama5d2-piobu.c | 16 ++++++++--------
drivers/gpio/gpio-syscon.c | 12 ++++++------
drivers/gpio/gpiolib-of.c | 3 +++
9 files changed, 32 insertions(+), 26 deletions(-)

--
2.25.1


2020-06-30 13:53:30

by Lee Jones

[permalink] [raw]
Subject: [PATCH 02/10] gpio: gpio-altera: Add missing kerneldoc entry and demote comment

'struct altera_gpio_chip's 'irq_chip' property is undocumented. So
add property description to the struct's kerneldoc header. Also
demote comment block which is clearly not in kerneldoc format.

Fixes the following W=1 warnings:

drivers/gpio/gpio-altera.c:34: warning: Function parameter or member 'irq_chip' not described in 'altera_gpio_chip'
drivers/gpio/gpio-altera.c:78: warning: Function parameter or member 'd' not described in 'altera_gpio_irq_set_type'
drivers/gpio/gpio-altera.c:78: warning: Function parameter or member 'type' not described in 'altera_gpio_irq_set_type'

Cc: Joyce Ooi <[email protected]>
Cc: Tien Hock Loh <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/gpio/gpio-altera.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
index cc4ba71e4fe3c..b7932ecc3b613 100644
--- a/drivers/gpio/gpio-altera.c
+++ b/drivers/gpio/gpio-altera.c
@@ -24,6 +24,7 @@
* @interrupt_trigger : specifies the hardware configured IRQ trigger type
* (rising, falling, both, high)
* @mapped_irq : kernel mapped irq number.
+* @irq_chip : IRQ chip configuration
*/
struct altera_gpio_chip {
struct of_mm_gpio_chip mmchip;
@@ -69,7 +70,7 @@ static void altera_gpio_irq_mask(struct irq_data *d)
raw_spin_unlock_irqrestore(&altera_gc->gpio_lock, flags);
}

-/**
+/*
* This controller's IRQ type is synthesized in hardware, so this function
* just checks if the requested set_type matches the synthesized IRQ type
*/
--
2.25.1

2020-06-30 13:54:19

by Lee Jones

[permalink] [raw]
Subject: [PATCH 09/10] gpio: gpio-mlxbf2: Tell the compiler that ACPI functions may not be use

... as is the case when !CONFIG_ACPI.

Fixes the following W=1 kernel build warning:

drivers/gpio/gpio-mlxbf2.c:312:36: warning: ‘mlxbf2_gpio_acpi_match’ defined but not used [-Wunused-const-variable=]
312 | static const struct acpi_device_id mlxbf2_gpio_acpi_match[] = {
| ^~~~~~~~~~~~~~~~~~~~~~

Cc: Asmaa Mnebhi <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/gpio/gpio-mlxbf2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c
index 94d5efce1721c..861a8d0a84be0 100644
--- a/drivers/gpio/gpio-mlxbf2.c
+++ b/drivers/gpio/gpio-mlxbf2.c
@@ -309,7 +309,7 @@ static int mlxbf2_gpio_resume(struct platform_device *pdev)
}
#endif

-static const struct acpi_device_id mlxbf2_gpio_acpi_match[] = {
+static const struct acpi_device_id __maybe_unused mlxbf2_gpio_acpi_match[] = {
{ "MLNXBF22", 0 },
{},
};
--
2.25.1

2020-06-30 13:54:32

by Lee Jones

[permalink] [raw]
Subject: [PATCH 06/10] gpio: gpio-syscon: Fix formatting issues which confuse kerneldoc

Kerneldoc expects struct properties to be documented using the syntax
'@.*: ', but no '@' has been provided in 'struct syscon_gpio_data's
header. Add them to stop confusing kerneldoc.

Fixes the following W=1 warnings:

drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'compatible' not described in 'syscon_gpio_data'
drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'flags' not described in 'syscon_gpio_data'
drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'bit_count' not described in 'syscon_gpio_data'
drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'dat_bit_offset' not described in 'syscon_gpio_data'
drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'dir_bit_offset' not described in 'syscon_gpio_data'
drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'set' not described in 'syscon_gpio_data'

Cc: Alexander Shiyan <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/gpio/gpio-syscon.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c
index 31f332074d7d5..fdd3d497b5350 100644
--- a/drivers/gpio/gpio-syscon.c
+++ b/drivers/gpio/gpio-syscon.c
@@ -24,16 +24,16 @@

/**
* struct syscon_gpio_data - Configuration for the device.
- * compatible: SYSCON driver compatible string.
- * flags: Set of GPIO_SYSCON_FEAT_ flags:
+ * @compatible: SYSCON driver compatible string.
+ * @flags: Set of GPIO_SYSCON_FEAT_ flags:
* GPIO_SYSCON_FEAT_IN: GPIOs supports input,
* GPIO_SYSCON_FEAT_OUT: GPIOs supports output,
* GPIO_SYSCON_FEAT_DIR: GPIOs supports switch direction.
- * bit_count: Number of bits used as GPIOs.
- * dat_bit_offset: Offset (in bits) to the first GPIO bit.
- * dir_bit_offset: Optional offset (in bits) to the first bit to switch
+ * @bit_count: Number of bits used as GPIOs.
+ * @dat_bit_offset: Offset (in bits) to the first GPIO bit.
+ * @dir_bit_offset: Optional offset (in bits) to the first bit to switch
* GPIO direction (Used with GPIO_SYSCON_FEAT_DIR flag).
- * set: HW specific callback to assigns output value
+ * @set: HW specific callback to assigns output value
* for signal "offset"
*/

--
2.25.1

2020-06-30 14:18:39

by Asmaa Mnebhi

[permalink] [raw]
Subject: RE: [PATCH 09/10] gpio: gpio-mlxbf2: Tell the compiler that ACPI functions may not be use

Reviewed-by: Asmaa Mnebhi <[email protected]>

Thank you.

-----Original Message-----
From: Lee Jones <[email protected]>
Sent: Tuesday, June 30, 2020 9:34 AM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Lee Jones <[email protected]>; Asmaa Mnebhi <[email protected]>
Subject: [PATCH 09/10] gpio: gpio-mlxbf2: Tell the compiler that ACPI functions may not be use

... as is the case when !CONFIG_ACPI.

Fixes the following W=1 kernel build warning:

drivers/gpio/gpio-mlxbf2.c:312:36: warning: ‘mlxbf2_gpio_acpi_match’ defined but not used [-Wunused-const-variable=]
312 | static const struct acpi_device_id mlxbf2_gpio_acpi_match[] = { | ^~~~~~~~~~~~~~~~~~~~~~

Cc: Asmaa Mnebhi <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/gpio/gpio-mlxbf2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c index 94d5efce1721c..861a8d0a84be0 100644
--- a/drivers/gpio/gpio-mlxbf2.c
+++ b/drivers/gpio/gpio-mlxbf2.c
@@ -309,7 +309,7 @@ static int mlxbf2_gpio_resume(struct platform_device *pdev) } #endif

-static const struct acpi_device_id mlxbf2_gpio_acpi_match[] = {
+static const struct acpi_device_id __maybe_unused
+mlxbf2_gpio_acpi_match[] = {
{ "MLNXBF22", 0 },
{},
};
--
2.25.1

2020-07-08 07:16:35

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 02/10] gpio: gpio-altera: Add missing kerneldoc entry and demote comment

On Tue, Jun 30, 2020 at 3:33 PM Lee Jones <[email protected]> wrote:

> 'struct altera_gpio_chip's 'irq_chip' property is undocumented. So
> add property description to the struct's kerneldoc header. Also
> demote comment block which is clearly not in kerneldoc format.
>
> Fixes the following W=1 warnings:
>
> drivers/gpio/gpio-altera.c:34: warning: Function parameter or member 'irq_chip' not described in 'altera_gpio_chip'
> drivers/gpio/gpio-altera.c:78: warning: Function parameter or member 'd' not described in 'altera_gpio_irq_set_type'
> drivers/gpio/gpio-altera.c:78: warning: Function parameter or member 'type' not described in 'altera_gpio_irq_set_type'
>
> Cc: Joyce Ooi <[email protected]>
> Cc: Tien Hock Loh <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>

Patch applied!

Yours,
Linus Walleij

2020-07-08 07:19:55

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 06/10] gpio: gpio-syscon: Fix formatting issues which confuse kerneldoc

On Tue, Jun 30, 2020 at 3:33 PM Lee Jones <[email protected]> wrote:

> Kerneldoc expects struct properties to be documented using the syntax
> '@.*: ', but no '@' has been provided in 'struct syscon_gpio_data's
> header. Add them to stop confusing kerneldoc.
>
> Fixes the following W=1 warnings:
>
> drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'compatible' not described in 'syscon_gpio_data'
> drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'flags' not described in 'syscon_gpio_data'
> drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'bit_count' not described in 'syscon_gpio_data'
> drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'dat_bit_offset' not described in 'syscon_gpio_data'
> drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'dir_bit_offset' not described in 'syscon_gpio_data'
> drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'set' not described in 'syscon_gpio_data'
>
> Cc: Alexander Shiyan <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>

Patch applied!

Yours,
Linus Walleij

2020-07-08 07:24:57

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 09/10] gpio: gpio-mlxbf2: Tell the compiler that ACPI functions may not be use

On Tue, Jun 30, 2020 at 3:33 PM Lee Jones <[email protected]> wrote:

> ... as is the case when !CONFIG_ACPI.
>
> Fixes the following W=1 kernel build warning:
>
> drivers/gpio/gpio-mlxbf2.c:312:36: warning: ‘mlxbf2_gpio_acpi_match’ defined but not used [-Wunused-const-variable=]
> 312 | static const struct acpi_device_id mlxbf2_gpio_acpi_match[] = {
> | ^~~~~~~~~~~~~~~~~~~~~~
>
> Cc: Asmaa Mnebhi <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>

Patch applied!

Yours,
Linus Walleij