All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: fix counting in spi-loopback-test code
@ 2016-01-13 20:51 ` Arnd Bergmann
  0 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2016-01-13 20:51 UTC (permalink / raw)
  To: broonie; +Cc: Martin Sperl, linux-spi, linux-arm-kernel, linux-kernel

These variables are always used uninitialized:

drivers/spi/spi-loopback-test.c: In function 'spi_test_run_iter':
drivers/spi/spi-loopback-test.c:768:17: warning: 'rx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/spi/spi-loopback-test.c:762:17: warning: 'tx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]

Adding an explicit initialization seems to be the only
workable solution here, to make the code behave correctly
and build without warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 84e0c4e5e2c4 ("spi: add loopback test driver to allow for spi_master regression tests")
---
The warning is hidden in allmodconfig at the moment because we build
that with -Os rather than -O2, which shows it.

diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c
index 894616f687b0..cf4bb36bee25 100644
--- a/drivers/spi/spi-loopback-test.c
+++ b/drivers/spi/spi-loopback-test.c
@@ -761,6 +761,7 @@ static int spi_test_run_iter(struct spi_device *spi,
 		test.iterate_transfer_mask = 1;
 
 	/* count number of transfers with tx/rx_buf != NULL */
+	rx_count = tx_count = 0;
 	for (i = 0; i < test.transfer_count; i++) {
 		if (test.transfers[i].tx_buf)
 			tx_count++;

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

* [PATCH] spi: fix counting in spi-loopback-test code
@ 2016-01-13 20:51 ` Arnd Bergmann
  0 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2016-01-13 20:51 UTC (permalink / raw)
  To: broonie-DgEjT+Ai2ygdnm+yROfE0A
  Cc: Martin Sperl, linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

These variables are always used uninitialized:

drivers/spi/spi-loopback-test.c: In function 'spi_test_run_iter':
drivers/spi/spi-loopback-test.c:768:17: warning: 'rx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/spi/spi-loopback-test.c:762:17: warning: 'tx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]

Adding an explicit initialization seems to be the only
workable solution here, to make the code behave correctly
and build without warning.

Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Fixes: 84e0c4e5e2c4 ("spi: add loopback test driver to allow for spi_master regression tests")
---
The warning is hidden in allmodconfig at the moment because we build
that with -Os rather than -O2, which shows it.

diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c
index 894616f687b0..cf4bb36bee25 100644
--- a/drivers/spi/spi-loopback-test.c
+++ b/drivers/spi/spi-loopback-test.c
@@ -761,6 +761,7 @@ static int spi_test_run_iter(struct spi_device *spi,
 		test.iterate_transfer_mask = 1;
 
 	/* count number of transfers with tx/rx_buf != NULL */
+	rx_count = tx_count = 0;
 	for (i = 0; i < test.transfer_count; i++) {
 		if (test.transfers[i].tx_buf)
 			tx_count++;

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH] spi: fix counting in spi-loopback-test code
@ 2016-01-13 20:51 ` Arnd Bergmann
  0 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2016-01-13 20:51 UTC (permalink / raw)
  To: linux-arm-kernel

These variables are always used uninitialized:

drivers/spi/spi-loopback-test.c: In function 'spi_test_run_iter':
drivers/spi/spi-loopback-test.c:768:17: warning: 'rx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/spi/spi-loopback-test.c:762:17: warning: 'tx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]

Adding an explicit initialization seems to be the only
workable solution here, to make the code behave correctly
and build without warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 84e0c4e5e2c4 ("spi: add loopback test driver to allow for spi_master regression tests")
---
The warning is hidden in allmodconfig at the moment because we build
that with -Os rather than -O2, which shows it.

diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c
index 894616f687b0..cf4bb36bee25 100644
--- a/drivers/spi/spi-loopback-test.c
+++ b/drivers/spi/spi-loopback-test.c
@@ -761,6 +761,7 @@ static int spi_test_run_iter(struct spi_device *spi,
 		test.iterate_transfer_mask = 1;
 
 	/* count number of transfers with tx/rx_buf != NULL */
+	rx_count = tx_count = 0;
 	for (i = 0; i < test.transfer_count; i++) {
 		if (test.transfers[i].tx_buf)
 			tx_count++;

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

* Re: [PATCH] spi: fix counting in spi-loopback-test code
  2016-01-13 20:51 ` Arnd Bergmann
  (?)
@ 2016-01-15 11:24   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2016-01-15 11:24 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Brown, Martin Sperl, linux-spi, linux-arm-kernel, linux-kernel

On Wed, Jan 13, 2016 at 9:51 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> These variables are always used uninitialized:
>
> drivers/spi/spi-loopback-test.c: In function 'spi_test_run_iter':
> drivers/spi/spi-loopback-test.c:768:17: warning: 'rx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/spi/spi-loopback-test.c:762:17: warning: 'tx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> Adding an explicit initialization seems to be the only
> workable solution here, to make the code behave correctly
> and build without warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 84e0c4e5e2c4 ("spi: add loopback test driver to allow for spi_master regression tests")

Just noticed the same, so
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] spi: fix counting in spi-loopback-test code
@ 2016-01-15 11:24   ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2016-01-15 11:24 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Brown, Martin Sperl, linux-spi, linux-arm-kernel, linux-kernel

On Wed, Jan 13, 2016 at 9:51 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> These variables are always used uninitialized:
>
> drivers/spi/spi-loopback-test.c: In function 'spi_test_run_iter':
> drivers/spi/spi-loopback-test.c:768:17: warning: 'rx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/spi/spi-loopback-test.c:762:17: warning: 'tx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> Adding an explicit initialization seems to be the only
> workable solution here, to make the code behave correctly
> and build without warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 84e0c4e5e2c4 ("spi: add loopback test driver to allow for spi_master regression tests")

Just noticed the same, so
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

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

* [PATCH] spi: fix counting in spi-loopback-test code
@ 2016-01-15 11:24   ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2016-01-15 11:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 13, 2016 at 9:51 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> These variables are always used uninitialized:
>
> drivers/spi/spi-loopback-test.c: In function 'spi_test_run_iter':
> drivers/spi/spi-loopback-test.c:768:17: warning: 'rx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/spi/spi-loopback-test.c:762:17: warning: 'tx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> Adding an explicit initialization seems to be the only
> workable solution here, to make the code behave correctly
> and build without warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 84e0c4e5e2c4 ("spi: add loopback test driver to allow for spi_master regression tests")

Just noticed the same, so
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Applied "spi: fix counting in spi-loopback-test code" to the spi tree
  2016-01-13 20:51 ` Arnd Bergmann
                   ` (2 preceding siblings ...)
  (?)
@ 2016-01-15 18:19 ` Mark Brown
  -1 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2016-01-15 18:19 UTC (permalink / raw)
  To: Arnd Bergmann, Geert Uytterhoeven, Mark Brown
  Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA

The patch

   spi: fix counting in spi-loopback-test code

has been applied to the spi tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From ebea7c0545d4d5e554b84c3ee8072f13c3fdd2ba Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Date: Wed, 13 Jan 2016 21:51:29 +0100
Subject: [PATCH] spi: fix counting in spi-loopback-test code

These variables are always used uninitialized:

drivers/spi/spi-loopback-test.c: In function 'spi_test_run_iter':
drivers/spi/spi-loopback-test.c:768:17: warning: 'rx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/spi/spi-loopback-test.c:762:17: warning: 'tx_count' may be used uninitialized in this function [-Wmaybe-uninitialized]

Adding an explicit initialization seems to be the only
workable solution here, to make the code behave correctly
and build without warning.

Fixes: 84e0c4e5e2c4 ("spi: add loopback test driver to allow for spi_master regression tests")
Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Acked-by: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Signed-off-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/spi/spi-loopback-test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c
index 894616f687b0..cf4bb36bee25 100644
--- a/drivers/spi/spi-loopback-test.c
+++ b/drivers/spi/spi-loopback-test.c
@@ -761,6 +761,7 @@ static int spi_test_run_iter(struct spi_device *spi,
 		test.iterate_transfer_mask = 1;
 
 	/* count number of transfers with tx/rx_buf != NULL */
+	rx_count = tx_count = 0;
 	for (i = 0; i < test.transfer_count; i++) {
 		if (test.transfers[i].tx_buf)
 			tx_count++;
-- 
2.7.0.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-01-15 18:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-13 20:51 [PATCH] spi: fix counting in spi-loopback-test code Arnd Bergmann
2016-01-13 20:51 ` Arnd Bergmann
2016-01-13 20:51 ` Arnd Bergmann
2016-01-15 11:24 ` Geert Uytterhoeven
2016-01-15 11:24   ` Geert Uytterhoeven
2016-01-15 11:24   ` Geert Uytterhoeven
2016-01-15 18:19 ` Applied "spi: fix counting in spi-loopback-test code" to the spi tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.