linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: spidev: Remove redundant initialization of variable status
@ 2020-09-09  6:08 Jay Fang
  2020-09-09  8:25 ` Geert Uytterhoeven
  2020-09-09 15:28 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Jay Fang @ 2020-09-09  6:08 UTC (permalink / raw)
  To: linux-spi; +Cc: broonie, huangdaode, linuxarm

In spidev_read() and spidev_write(), the variable status is being
initialized with a value that is never read and it is being updated
later with a new value. The initialization is redundant and can be
removed.

Signed-off-by: Jay Fang <f.fangjian@huawei.com>
---
 drivers/spi/spidev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 455e99c..859910e 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -146,7 +146,7 @@ static ssize_t
 spidev_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
 {
 	struct spidev_data	*spidev;
-	ssize_t			status = 0;
+	ssize_t			status;
 
 	/* chipselect only toggles at start or end of operation */
 	if (count > bufsiz)
@@ -176,7 +176,7 @@ spidev_write(struct file *filp, const char __user *buf,
 		size_t count, loff_t *f_pos)
 {
 	struct spidev_data	*spidev;
-	ssize_t			status = 0;
+	ssize_t			status;
 	unsigned long		missing;
 
 	/* chipselect only toggles at start or end of operation */
-- 
2.7.4


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

* Re: [PATCH] spi: spidev: Remove redundant initialization of variable status
  2020-09-09  6:08 [PATCH] spi: spidev: Remove redundant initialization of variable status Jay Fang
@ 2020-09-09  8:25 ` Geert Uytterhoeven
  2020-09-09 15:28 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2020-09-09  8:25 UTC (permalink / raw)
  To: Jay Fang; +Cc: linux-spi, Mark Brown, huangdaode, Linuxarm

On Wed, Sep 9, 2020 at 8:11 AM Jay Fang <f.fangjian@huawei.com> wrote:
> In spidev_read() and spidev_write(), the variable status is being
> initialized with a value that is never read and it is being updated
> later with a new value. The initialization is redundant and can be
> removed.
>
> Signed-off-by: Jay Fang <f.fangjian@huawei.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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] 3+ messages in thread

* Re: [PATCH] spi: spidev: Remove redundant initialization of variable status
  2020-09-09  6:08 [PATCH] spi: spidev: Remove redundant initialization of variable status Jay Fang
  2020-09-09  8:25 ` Geert Uytterhoeven
@ 2020-09-09 15:28 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-09-09 15:28 UTC (permalink / raw)
  To: Jay Fang, linux-spi; +Cc: huangdaode, linuxarm

On Wed, 9 Sep 2020 14:08:24 +0800, Jay Fang wrote:
> In spidev_read() and spidev_write(), the variable status is being
> initialized with a value that is never read and it is being updated
> later with a new value. The initialization is redundant and can be
> removed.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: spidev: Remove redundant initialization of variable status
      commit: 4ebf8816e35d63db723d95f8e49d8455be926c36

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

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

end of thread, other threads:[~2020-09-09 17:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-09  6:08 [PATCH] spi: spidev: Remove redundant initialization of variable status Jay Fang
2020-09-09  8:25 ` Geert Uytterhoeven
2020-09-09 15:28 ` Mark Brown

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