Linux-Amlogic Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] rtc: meson: remove redundant assignment to variable retries
@ 2019-11-22 22:52 Colin King
  2019-11-23  9:40 ` Martin Blumenstingl
  2019-11-26 22:14 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2019-11-22 22:52 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Kevin Hilman, linux-rtc,
	linux-arm-kernel, linux-amlogic
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable retries is being initialized with a value that is never
read and it is being updated later with a new value in a for-loop.
The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/rtc/rtc-meson.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-meson.c b/drivers/rtc/rtc-meson.c
index 9bd8478db34b..47ebcf834cc2 100644
--- a/drivers/rtc/rtc-meson.c
+++ b/drivers/rtc/rtc-meson.c
@@ -131,7 +131,7 @@ static u32 meson_rtc_get_data(struct meson_rtc *rtc)
 
 static int meson_rtc_get_bus(struct meson_rtc *rtc)
 {
-	int ret, retries = 3;
+	int ret, retries;
 	u32 val;
 
 	/* prepare bus for transfers, set all lines low */
-- 
2.24.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH] rtc: meson: remove redundant assignment to variable retries
  2019-11-22 22:52 [PATCH] rtc: meson: remove redundant assignment to variable retries Colin King
@ 2019-11-23  9:40 ` Martin Blumenstingl
  2019-11-26 22:14 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Blumenstingl @ 2019-11-23  9:40 UTC (permalink / raw)
  To: Colin King
  Cc: linux-rtc, Alessandro Zummo, Alexandre Belloni, Kevin Hilman,
	kernel-janitors, linux-kernel, linux-amlogic, linux-arm-kernel

Hi Colin,

On Fri, Nov 22, 2019 at 11:52 PM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable retries is being initialized with a value that is never
> read and it is being updated later with a new value in a for-loop.
> The initialization is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
thank you for addressing this!
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>


Martin

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH] rtc: meson: remove redundant assignment to variable retries
  2019-11-22 22:52 [PATCH] rtc: meson: remove redundant assignment to variable retries Colin King
  2019-11-23  9:40 ` Martin Blumenstingl
@ 2019-11-26 22:14 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2019-11-26 22:14 UTC (permalink / raw)
  To: Colin King
  Cc: linux-rtc, Alessandro Zummo, Kevin Hilman, kernel-janitors,
	linux-kernel, linux-amlogic, linux-arm-kernel

On 22/11/2019 22:52:10+0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable retries is being initialized with a value that is never
> read and it is being updated later with a new value in a for-loop.
> The initialization is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/rtc/rtc-meson.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
Applied, thanks.

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

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ 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 --
2019-11-22 22:52 [PATCH] rtc: meson: remove redundant assignment to variable retries Colin King
2019-11-23  9:40 ` Martin Blumenstingl
2019-11-26 22:14 ` Alexandre Belloni

Linux-Amlogic Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-amlogic/0 linux-amlogic/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-amlogic linux-amlogic/ https://lore.kernel.org/linux-amlogic \
		linux-amlogic@lists.infradead.org
	public-inbox-index linux-amlogic

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-amlogic


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