linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] rtc: fix W=1 warnings and errors
@ 2019-11-22 10:22 Alexandre Belloni
  2019-11-22 10:22 ` [PATCH 1/8] rtc: sysfs: fix hctosys_show kerneldoc Alexandre Belloni
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Alexandre Belloni @ 2019-11-22 10:22 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

This series fixes kerneldoc and unused variables issues detected when
using W=1.

Alexandre Belloni (8):
  rtc: sysfs: fix hctosys_show kerneldoc
  rtc: ds1374: remove unused variable
  rtc: ds1685: remove set but unused variables
  rtc: ds1685: fix build error with make W=1
  rtc: m41t80: remove excess kerneldoc
  rtc: pm8xxx: update kerneldoc for struct pm8xxx_rtc
  rtc: tegra: remove set but unused variable
  rtc: v3020: remove set but unused variable

 drivers/rtc/rtc-ds1374.c |  3 +--
 drivers/rtc/rtc-ds1685.c | 12 +++++-------
 drivers/rtc/rtc-m41t80.c |  1 -
 drivers/rtc/rtc-pm8xxx.c |  2 +-
 drivers/rtc/rtc-tegra.c  |  4 ++--
 drivers/rtc/rtc-v3020.c  |  3 +--
 drivers/rtc/sysfs.c      |  5 ++++-
 7 files changed, 14 insertions(+), 16 deletions(-)

-- 
2.23.0


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

* [PATCH 1/8] rtc: sysfs: fix hctosys_show kerneldoc
  2019-11-22 10:22 [PATCH 0/8] rtc: fix W=1 warnings and errors Alexandre Belloni
@ 2019-11-22 10:22 ` Alexandre Belloni
  2019-11-22 10:22 ` [PATCH 2/8] rtc: ds1374: remove unused variable Alexandre Belloni
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Alexandre Belloni @ 2019-11-22 10:22 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

Fix undocumented function parameters:
drivers/rtc/sysfs.c:112: warning: Function parameter or member 'dev' not described in 'hctosys_show'
drivers/rtc/sysfs.c:112: warning: Function parameter or member 'attr' not described in 'hctosys_show'
drivers/rtc/sysfs.c:112: warning: Function parameter or member 'buf' not described in 'hctosys_show'

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/sysfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/sysfs.c b/drivers/rtc/sysfs.c
index be3531e7f868..b7ca7d79fb28 100644
--- a/drivers/rtc/sysfs.c
+++ b/drivers/rtc/sysfs.c
@@ -103,8 +103,11 @@ static DEVICE_ATTR_RW(max_user_freq);
 
 /**
  * rtc_sysfs_show_hctosys - indicate if the given RTC set the system time
+ * @dev: The device that the attribute belongs to.
+ * @attr: The attribute being read.
+ * @buf: The result buffer.
  *
- * Returns 1 if the system clock was set by this RTC at the last
+ * buf is "1" if the system clock was set by this RTC at the last
  * boot or resume event.
  */
 static ssize_t
-- 
2.23.0


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

* [PATCH 2/8] rtc: ds1374: remove unused variable
  2019-11-22 10:22 [PATCH 0/8] rtc: fix W=1 warnings and errors Alexandre Belloni
  2019-11-22 10:22 ` [PATCH 1/8] rtc: sysfs: fix hctosys_show kerneldoc Alexandre Belloni
@ 2019-11-22 10:22 ` Alexandre Belloni
  2019-11-22 10:22 ` [PATCH 3/8] rtc: ds1685: remove set but unused variables Alexandre Belloni
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Alexandre Belloni @ 2019-11-22 10:22 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

Fix warning:

drivers/rtc/rtc-ds1374.c: In function ‘ds1374_wdt_disable’:
drivers/rtc/rtc-ds1374.c:442:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-ds1374.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c
index 367497914c10..96eba7606523 100644
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -439,14 +439,13 @@ static void ds1374_wdt_ping(void)
 
 static void ds1374_wdt_disable(void)
 {
-	int ret = -ENOIOCTLCMD;
 	int cr;
 
 	cr = i2c_smbus_read_byte_data(save_client, DS1374_REG_CR);
 	/* Disable watchdog timer */
 	cr &= ~DS1374_REG_CR_WACE;
 
-	ret = i2c_smbus_write_byte_data(save_client, DS1374_REG_CR, cr);
+	i2c_smbus_write_byte_data(save_client, DS1374_REG_CR, cr);
 }
 
 /*
-- 
2.23.0


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

* [PATCH 3/8] rtc: ds1685: remove set but unused variables
  2019-11-22 10:22 [PATCH 0/8] rtc: fix W=1 warnings and errors Alexandre Belloni
  2019-11-22 10:22 ` [PATCH 1/8] rtc: sysfs: fix hctosys_show kerneldoc Alexandre Belloni
  2019-11-22 10:22 ` [PATCH 2/8] rtc: ds1374: remove unused variable Alexandre Belloni
@ 2019-11-22 10:22 ` Alexandre Belloni
  2019-11-23  5:16   ` Joshua Kinard
  2019-11-22 10:22 ` [PATCH 4/8] rtc: ds1685: fix build error with make W=1 Alexandre Belloni
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Alexandre Belloni @ 2019-11-22 10:22 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni, Joshua Kinard

Fix the following warnings:
drivers/rtc/rtc-ds1685.c: In function ‘ds1685_rtc_read_time’:
drivers/rtc/rtc-ds1685.c:264:5: warning: variable ‘ctrlb’ set but not used [-Wunused-but-set-variable]
  264 |  u8 ctrlb, century;
      |     ^~~~~
drivers/rtc/rtc-ds1685.c: In function ‘ds1685_rtc_proc’:
drivers/rtc/rtc-ds1685.c:758:19: warning: variable ‘ctrlc’ set but not used [-Wunused-but-set-variable]
  758 |  u8 ctrla, ctrlb, ctrlc, ctrld, ctrl4a, ctrl4b, ssn[8];
      |                   ^~~~~
Cc: Joshua Kinard <kumba@gentoo.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-ds1685.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
index 98d06b3ee913..8419595e7da7 100644
--- a/drivers/rtc/rtc-ds1685.c
+++ b/drivers/rtc/rtc-ds1685.c
@@ -261,7 +261,7 @@ static int
 ds1685_rtc_read_time(struct device *dev, struct rtc_time *tm)
 {
 	struct ds1685_priv *rtc = dev_get_drvdata(dev);
-	u8 ctrlb, century;
+	u8 century;
 	u8 seconds, minutes, hours, wday, mday, month, years;
 
 	/* Fetch the time info from the RTC registers. */
@@ -274,7 +274,6 @@ ds1685_rtc_read_time(struct device *dev, struct rtc_time *tm)
 	month   = rtc->read(rtc, RTC_MONTH);
 	years   = rtc->read(rtc, RTC_YEAR);
 	century = rtc->read(rtc, RTC_CENTURY);
-	ctrlb   = rtc->read(rtc, RTC_CTRL_B);
 	ds1685_rtc_end_data_access(rtc);
 
 	/* bcd2bin if needed, perform fixups, and store to rtc_time. */
@@ -755,7 +754,7 @@ static int
 ds1685_rtc_proc(struct device *dev, struct seq_file *seq)
 {
 	struct ds1685_priv *rtc = dev_get_drvdata(dev);
-	u8 ctrla, ctrlb, ctrlc, ctrld, ctrl4a, ctrl4b, ssn[8];
+	u8 ctrla, ctrlb, ctrld, ctrl4a, ctrl4b, ssn[8];
 	char *model;
 
 	/* Read all the relevant data from the control registers. */
@@ -763,7 +762,6 @@ ds1685_rtc_proc(struct device *dev, struct seq_file *seq)
 	ds1685_rtc_get_ssn(rtc, ssn);
 	ctrla = rtc->read(rtc, RTC_CTRL_A);
 	ctrlb = rtc->read(rtc, RTC_CTRL_B);
-	ctrlc = rtc->read(rtc, RTC_CTRL_C);
 	ctrld = rtc->read(rtc, RTC_CTRL_D);
 	ctrl4a = rtc->read(rtc, RTC_EXT_CTRL_4A);
 	ctrl4b = rtc->read(rtc, RTC_EXT_CTRL_4B);
-- 
2.23.0


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

* [PATCH 4/8] rtc: ds1685: fix build error with make W=1
  2019-11-22 10:22 [PATCH 0/8] rtc: fix W=1 warnings and errors Alexandre Belloni
                   ` (2 preceding siblings ...)
  2019-11-22 10:22 ` [PATCH 3/8] rtc: ds1685: remove set but unused variables Alexandre Belloni
@ 2019-11-22 10:22 ` Alexandre Belloni
  2019-11-23  5:19   ` Joshua Kinard
  2019-11-22 10:22 ` [PATCH 5/8] rtc: m41t80: remove excess kerneldoc Alexandre Belloni
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Alexandre Belloni @ 2019-11-22 10:22 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni, Joshua Kinard

Fix the following parsing errors when building with W=1:
drivers/rtc/rtc-ds1685.c:1053: error: Cannot parse struct or union!
drivers/rtc/rtc-ds1685.c:1062: error: Cannot parse struct or union!
drivers/rtc/rtc-ds1685.c:1363: warning: cannot understand function prototype: 'struct platform_driver ds1685_rtc_driver = '

Cc: Joshua Kinard <kumba@gentoo.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-ds1685.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
index 8419595e7da7..56c670af2e50 100644
--- a/drivers/rtc/rtc-ds1685.c
+++ b/drivers/rtc/rtc-ds1685.c
@@ -1039,7 +1039,7 @@ ds1685_rtc_sysfs_serial_show(struct device *dev,
 }
 static DEVICE_ATTR(serial, S_IRUGO, ds1685_rtc_sysfs_serial_show, NULL);
 
-/**
+/*
  * struct ds1685_rtc_sysfs_misc_attrs - list for misc RTC features.
  */
 static struct attribute*
@@ -1050,7 +1050,7 @@ ds1685_rtc_sysfs_misc_attrs[] = {
 	NULL,
 };
 
-/**
+/*
  * struct ds1685_rtc_sysfs_misc_grp - attr group for misc RTC features.
  */
 static const struct attribute_group
@@ -1355,7 +1355,7 @@ ds1685_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-/**
+/*
  * ds1685_rtc_driver - rtc driver properties.
  */
 static struct platform_driver ds1685_rtc_driver = {
-- 
2.23.0


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

* [PATCH 5/8] rtc: m41t80: remove excess kerneldoc
  2019-11-22 10:22 [PATCH 0/8] rtc: fix W=1 warnings and errors Alexandre Belloni
                   ` (3 preceding siblings ...)
  2019-11-22 10:22 ` [PATCH 4/8] rtc: ds1685: fix build error with make W=1 Alexandre Belloni
@ 2019-11-22 10:22 ` Alexandre Belloni
  2019-11-22 10:22 ` [PATCH 6/8] rtc: pm8xxx: update kerneldoc for struct pm8xxx_rtc Alexandre Belloni
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Alexandre Belloni @ 2019-11-22 10:22 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

Fix the following warning:
drivers/rtc/rtc-m41t80.c:716: warning: Excess function parameter 'inode' description in 'wdt_ioctl'

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-m41t80.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index b813295a2eb5..5094a8cf9691 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -702,7 +702,6 @@ static ssize_t wdt_read(struct file *file, char __user *buf,
 
 /**
  *	wdt_ioctl:
- *	@inode: inode of the device
  *	@file: file handle to the device
  *	@cmd: watchdog command
  *	@arg: argument pointer
-- 
2.23.0


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

* [PATCH 6/8] rtc: pm8xxx: update kerneldoc for struct pm8xxx_rtc
  2019-11-22 10:22 [PATCH 0/8] rtc: fix W=1 warnings and errors Alexandre Belloni
                   ` (4 preceding siblings ...)
  2019-11-22 10:22 ` [PATCH 5/8] rtc: m41t80: remove excess kerneldoc Alexandre Belloni
@ 2019-11-22 10:22 ` Alexandre Belloni
  2019-11-22 10:22 ` [PATCH 7/8] rtc: tegra: remove set but unused variable Alexandre Belloni
  2019-11-22 10:22 ` [PATCH 8/8] rtc: v3020: " Alexandre Belloni
  7 siblings, 0 replies; 13+ messages in thread
From: Alexandre Belloni @ 2019-11-22 10:22 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

The change from u8 ctrl_reg to const struct pm8xxx_rtc_regs *regs; did not
properly update the kerneldoc comment. Fixes:

drivers/rtc/rtc-pm8xxx.c:64: warning: Function parameter or member 'regs' not described in 'pm8xxx_rtc'

Fixes: c8d523a4b053 ("drivers/rtc/rtc-pm8xxx.c: rework to support pm8941 rtc")
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-pm8xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c
index f5a30e0f16c2..07ea1be3abb9 100644
--- a/drivers/rtc/rtc-pm8xxx.c
+++ b/drivers/rtc/rtc-pm8xxx.c
@@ -49,7 +49,7 @@ struct pm8xxx_rtc_regs {
  * @regmap:		regmap used to access RTC registers
  * @allow_set_time:	indicates whether writing to the RTC is allowed
  * @rtc_alarm_irq:	rtc alarm irq number.
- * @ctrl_reg:		rtc control register.
+ * @regs:		rtc registers description.
  * @rtc_dev:		device structure.
  * @ctrl_reg_lock:	spinlock protecting access to ctrl_reg.
  */
-- 
2.23.0


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

* [PATCH 7/8] rtc: tegra: remove set but unused variable
  2019-11-22 10:22 [PATCH 0/8] rtc: fix W=1 warnings and errors Alexandre Belloni
                   ` (5 preceding siblings ...)
  2019-11-22 10:22 ` [PATCH 6/8] rtc: pm8xxx: update kerneldoc for struct pm8xxx_rtc Alexandre Belloni
@ 2019-11-22 10:22 ` Alexandre Belloni
  2019-11-22 12:46   ` Thierry Reding
  2019-11-22 10:22 ` [PATCH 8/8] rtc: v3020: " Alexandre Belloni
  7 siblings, 1 reply; 13+ messages in thread
From: Alexandre Belloni @ 2019-11-22 10:22 UTC (permalink / raw)
  To: linux-rtc
  Cc: linux-kernel, Alexandre Belloni, Thierry Reding, Jonathan Hunter

Fix the following warning:
drivers/rtc/rtc-tegra.c: In function ‘tegra_rtc_read_time’:
drivers/rtc/rtc-tegra.c:106:11: warning: variable ‘msec’ set but not used [-Wunused-but-set-variable]

Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-tegra.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index 0159069bb506..7fbb1741692f 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -103,7 +103,7 @@ static int tegra_rtc_read_time(struct device *dev, struct rtc_time *tm)
 {
 	struct tegra_rtc_info *info = dev_get_drvdata(dev);
 	unsigned long flags;
-	u32 sec, msec;
+	u32 sec;
 
 	/*
 	 * RTC hardware copies seconds to shadow seconds when a read of
@@ -111,7 +111,7 @@ static int tegra_rtc_read_time(struct device *dev, struct rtc_time *tm)
 	 */
 	spin_lock_irqsave(&info->lock, flags);
 
-	msec = readl(info->base + TEGRA_RTC_REG_MILLI_SECONDS);
+	readl(info->base + TEGRA_RTC_REG_MILLI_SECONDS);
 	sec = readl(info->base + TEGRA_RTC_REG_SHADOW_SECONDS);
 
 	spin_unlock_irqrestore(&info->lock, flags);
-- 
2.23.0


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

* [PATCH 8/8] rtc: v3020: remove set but unused variable
  2019-11-22 10:22 [PATCH 0/8] rtc: fix W=1 warnings and errors Alexandre Belloni
                   ` (6 preceding siblings ...)
  2019-11-22 10:22 ` [PATCH 7/8] rtc: tegra: remove set but unused variable Alexandre Belloni
@ 2019-11-22 10:22 ` Alexandre Belloni
  7 siblings, 0 replies; 13+ messages in thread
From: Alexandre Belloni @ 2019-11-22 10:22 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

Fix the following warning:
drivers/rtc/rtc-v3020.c: In function ‘rtc_probe’:
drivers/rtc/rtc-v3020.c:287:6: warning: variable ‘temp’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-v3020.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c
index 63ffba21397b..d2da92187d56 100644
--- a/drivers/rtc/rtc-v3020.c
+++ b/drivers/rtc/rtc-v3020.c
@@ -284,7 +284,6 @@ static int rtc_probe(struct platform_device *pdev)
 	struct v3020 *chip;
 	int retval = -EBUSY;
 	int i;
-	int temp;
 
 	chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
 	if (!chip)
@@ -302,7 +301,7 @@ static int rtc_probe(struct platform_device *pdev)
 	/* Make sure the v3020 expects a communication cycle
 	 * by reading 8 times */
 	for (i = 0; i < 8; i++)
-		temp = chip->ops->read_bit(chip);
+		chip->ops->read_bit(chip);
 
 	/* Test chip by doing a write/read sequence
 	 * to the chip ram */
-- 
2.23.0


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

* Re: [PATCH 7/8] rtc: tegra: remove set but unused variable
  2019-11-22 10:22 ` [PATCH 7/8] rtc: tegra: remove set but unused variable Alexandre Belloni
@ 2019-11-22 12:46   ` Thierry Reding
  0 siblings, 0 replies; 13+ messages in thread
From: Thierry Reding @ 2019-11-22 12:46 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel, Jonathan Hunter

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

On Fri, Nov 22, 2019 at 11:22:11AM +0100, Alexandre Belloni wrote:
> Fix the following warning:
> drivers/rtc/rtc-tegra.c: In function ‘tegra_rtc_read_time’:
> drivers/rtc/rtc-tegra.c:106:11: warning: variable ‘msec’ set but not used [-Wunused-but-set-variable]
> 
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Jonathan Hunter <jonathanh@nvidia.com>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
>  drivers/rtc/rtc-tegra.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 3/8] rtc: ds1685: remove set but unused variables
  2019-11-22 10:22 ` [PATCH 3/8] rtc: ds1685: remove set but unused variables Alexandre Belloni
@ 2019-11-23  5:16   ` Joshua Kinard
  0 siblings, 0 replies; 13+ messages in thread
From: Joshua Kinard @ 2019-11-23  5:16 UTC (permalink / raw)
  To: Alexandre Belloni, linux-rtc; +Cc: linux-kernel

On 11/22/2019 05:22, Alexandre Belloni wrote:
> Fix the following warnings:
> drivers/rtc/rtc-ds1685.c: In function ‘ds1685_rtc_read_time’:
> drivers/rtc/rtc-ds1685.c:264:5: warning: variable ‘ctrlb’ set but not used [-Wunused-but-set-variable]
>   264 |  u8 ctrlb, century;
>       |     ^~~~~
> drivers/rtc/rtc-ds1685.c: In function ‘ds1685_rtc_proc’:
> drivers/rtc/rtc-ds1685.c:758:19: warning: variable ‘ctrlc’ set but not used [-Wunused-but-set-variable]
>   758 |  u8 ctrla, ctrlb, ctrlc, ctrld, ctrl4a, ctrl4b, ssn[8];
>       |                   ^~~~~
> Cc: Joshua Kinard <kumba@gentoo.org>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
>  drivers/rtc/rtc-ds1685.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
> index 98d06b3ee913..8419595e7da7 100644
> --- a/drivers/rtc/rtc-ds1685.c
> +++ b/drivers/rtc/rtc-ds1685.c
> @@ -261,7 +261,7 @@ static int
>  ds1685_rtc_read_time(struct device *dev, struct rtc_time *tm)
>  {
>  	struct ds1685_priv *rtc = dev_get_drvdata(dev);
> -	u8 ctrlb, century;
> +	u8 century;
>  	u8 seconds, minutes, hours, wday, mday, month, years;
>  
>  	/* Fetch the time info from the RTC registers. */
> @@ -274,7 +274,6 @@ ds1685_rtc_read_time(struct device *dev, struct rtc_time *tm)
>  	month   = rtc->read(rtc, RTC_MONTH);
>  	years   = rtc->read(rtc, RTC_YEAR);
>  	century = rtc->read(rtc, RTC_CENTURY);
> -	ctrlb   = rtc->read(rtc, RTC_CTRL_B);
>  	ds1685_rtc_end_data_access(rtc);
>  
>  	/* bcd2bin if needed, perform fixups, and store to rtc_time. */
> @@ -755,7 +754,7 @@ static int
>  ds1685_rtc_proc(struct device *dev, struct seq_file *seq)
>  {
>  	struct ds1685_priv *rtc = dev_get_drvdata(dev);
> -	u8 ctrla, ctrlb, ctrlc, ctrld, ctrl4a, ctrl4b, ssn[8];
> +	u8 ctrla, ctrlb, ctrld, ctrl4a, ctrl4b, ssn[8];
>  	char *model;
>  
>  	/* Read all the relevant data from the control registers. */
> @@ -763,7 +762,6 @@ ds1685_rtc_proc(struct device *dev, struct seq_file *seq)
>  	ds1685_rtc_get_ssn(rtc, ssn);
>  	ctrla = rtc->read(rtc, RTC_CTRL_A);
>  	ctrlb = rtc->read(rtc, RTC_CTRL_B);
> -	ctrlc = rtc->read(rtc, RTC_CTRL_C);
>  	ctrld = rtc->read(rtc, RTC_CTRL_D);
>  	ctrl4a = rtc->read(rtc, RTC_EXT_CTRL_4A);
>  	ctrl4b = rtc->read(rtc, RTC_EXT_CTRL_4B);
> 

Acked-By: Joshua Kinard <kumba@gentoo.org>

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

* Re: [PATCH 4/8] rtc: ds1685: fix build error with make W=1
  2019-11-22 10:22 ` [PATCH 4/8] rtc: ds1685: fix build error with make W=1 Alexandre Belloni
@ 2019-11-23  5:19   ` Joshua Kinard
  2019-11-26 21:16     ` Alexandre Belloni
  0 siblings, 1 reply; 13+ messages in thread
From: Joshua Kinard @ 2019-11-23  5:19 UTC (permalink / raw)
  To: Alexandre Belloni, linux-rtc; +Cc: linux-kernel

On 11/22/2019 05:22, Alexandre Belloni wrote:
> Fix the following parsing errors when building with W=1:
> drivers/rtc/rtc-ds1685.c:1053: error: Cannot parse struct or union!
> drivers/rtc/rtc-ds1685.c:1062: error: Cannot parse struct or union!
> drivers/rtc/rtc-ds1685.c:1363: warning: cannot understand function prototype: 'struct platform_driver ds1685_rtc_driver = '
> 
> Cc: Joshua Kinard <kumba@gentoo.org>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
>  drivers/rtc/rtc-ds1685.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
> index 8419595e7da7..56c670af2e50 100644
> --- a/drivers/rtc/rtc-ds1685.c
> +++ b/drivers/rtc/rtc-ds1685.c
> @@ -1039,7 +1039,7 @@ ds1685_rtc_sysfs_serial_show(struct device *dev,
>  }
>  static DEVICE_ATTR(serial, S_IRUGO, ds1685_rtc_sysfs_serial_show, NULL);
>  
> -/**
> +/*
>   * struct ds1685_rtc_sysfs_misc_attrs - list for misc RTC features.
>   */
>  static struct attribute*
> @@ -1050,7 +1050,7 @@ ds1685_rtc_sysfs_misc_attrs[] = {
>  	NULL,
>  };
>  
> -/**
> +/*
>   * struct ds1685_rtc_sysfs_misc_grp - attr group for misc RTC features.
>   */
>  static const struct attribute_group
> @@ -1355,7 +1355,7 @@ ds1685_rtc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -/**
> +/*
>   * ds1685_rtc_driver - rtc driver properties.
>   */
>  static struct platform_driver ds1685_rtc_driver = {
> 

/** is for kerneldoc comments.  Is this a bug in kbuild's W=1 implementation
of not parsing kerneldoc on a struct correctly?  I'm sure I got that syntax
for structs out of the kerneldoc guide, unless it changed at some point.

-- 
Joshua Kinard
Gentoo/MIPS
kumba@gentoo.org
rsa6144/5C63F4E3F5C6C943 2015-04-27
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943

"The past tempts us, the present confuses us, the future frightens us.  And
our lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic

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

* Re: [PATCH 4/8] rtc: ds1685: fix build error with make W=1
  2019-11-23  5:19   ` Joshua Kinard
@ 2019-11-26 21:16     ` Alexandre Belloni
  0 siblings, 0 replies; 13+ messages in thread
From: Alexandre Belloni @ 2019-11-26 21:16 UTC (permalink / raw)
  To: Joshua Kinard; +Cc: linux-rtc, linux-kernel

On 23/11/2019 00:19:45-0500, Joshua Kinard wrote:
> On 11/22/2019 05:22, Alexandre Belloni wrote:
> > Fix the following parsing errors when building with W=1:
> > drivers/rtc/rtc-ds1685.c:1053: error: Cannot parse struct or union!
> > drivers/rtc/rtc-ds1685.c:1062: error: Cannot parse struct or union!
> > drivers/rtc/rtc-ds1685.c:1363: warning: cannot understand function prototype: 'struct platform_driver ds1685_rtc_driver = '
> > 
> > Cc: Joshua Kinard <kumba@gentoo.org>
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > ---
> >  drivers/rtc/rtc-ds1685.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
> > index 8419595e7da7..56c670af2e50 100644
> > --- a/drivers/rtc/rtc-ds1685.c
> > +++ b/drivers/rtc/rtc-ds1685.c
> > @@ -1039,7 +1039,7 @@ ds1685_rtc_sysfs_serial_show(struct device *dev,
> >  }
> >  static DEVICE_ATTR(serial, S_IRUGO, ds1685_rtc_sysfs_serial_show, NULL);
> >  
> > -/**
> > +/*
> >   * struct ds1685_rtc_sysfs_misc_attrs - list for misc RTC features.
> >   */
> >  static struct attribute*
> > @@ -1050,7 +1050,7 @@ ds1685_rtc_sysfs_misc_attrs[] = {
> >  	NULL,
> >  };
> >  
> > -/**
> > +/*
> >   * struct ds1685_rtc_sysfs_misc_grp - attr group for misc RTC features.
> >   */
> >  static const struct attribute_group
> > @@ -1355,7 +1355,7 @@ ds1685_rtc_remove(struct platform_device *pdev)
> >  	return 0;
> >  }
> >  
> > -/**
> > +/*
> >   * ds1685_rtc_driver - rtc driver properties.
> >   */
> >  static struct platform_driver ds1685_rtc_driver = {
> > 
> 
> /** is for kerneldoc comments.  Is this a bug in kbuild's W=1 implementation
> of not parsing kerneldoc on a struct correctly?  I'm sure I got that syntax
> for structs out of the kerneldoc guide, unless it changed at some point.
> 

I would think it is gcc that is choking on that, probably because the
members are not described.


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2019-11-26 21:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22 10:22 [PATCH 0/8] rtc: fix W=1 warnings and errors Alexandre Belloni
2019-11-22 10:22 ` [PATCH 1/8] rtc: sysfs: fix hctosys_show kerneldoc Alexandre Belloni
2019-11-22 10:22 ` [PATCH 2/8] rtc: ds1374: remove unused variable Alexandre Belloni
2019-11-22 10:22 ` [PATCH 3/8] rtc: ds1685: remove set but unused variables Alexandre Belloni
2019-11-23  5:16   ` Joshua Kinard
2019-11-22 10:22 ` [PATCH 4/8] rtc: ds1685: fix build error with make W=1 Alexandre Belloni
2019-11-23  5:19   ` Joshua Kinard
2019-11-26 21:16     ` Alexandre Belloni
2019-11-22 10:22 ` [PATCH 5/8] rtc: m41t80: remove excess kerneldoc Alexandre Belloni
2019-11-22 10:22 ` [PATCH 6/8] rtc: pm8xxx: update kerneldoc for struct pm8xxx_rtc Alexandre Belloni
2019-11-22 10:22 ` [PATCH 7/8] rtc: tegra: remove set but unused variable Alexandre Belloni
2019-11-22 12:46   ` Thierry Reding
2019-11-22 10:22 ` [PATCH 8/8] rtc: v3020: " Alexandre Belloni

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).