linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] spi: Fix self assignment issue with ancillary->mode
@ 2021-06-23 17:23 Colin King
  2021-06-25 13:24 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-06-23 17:23 UTC (permalink / raw)
  To: Mark Brown, linux-spi; +Cc: kernel-janitors, linux-kernel

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

There is an assignment of ancillary->mode to itself which looks
dubious since the proceeding comment states that the speed and
mode is taken over from the SPI main device, indicating that
ancillary->mode should assigned using the value spi->mode.
Fix this.

Addresses-Coverity: ("Self assignment")
Fixes: 0c79378c0199 ("spi: add ancillary device support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/spi/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index b1b6031961b7..3104055a54e2 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2184,7 +2184,7 @@ struct spi_device *spi_new_ancillary_device(struct spi_device *spi,
 
 	/* Take over SPI mode/speed from SPI main device */
 	ancillary->max_speed_hz = spi->max_speed_hz;
-	ancillary->mode = ancillary->mode;
+	ancillary->mode = spi->mode;
 
 	/* Register the new device */
 	rc = spi_add_device_locked(ancillary);
-- 
2.31.1


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

* Re: [PATCH][next] spi: Fix self assignment issue with ancillary->mode
  2021-06-23 17:23 [PATCH][next] spi: Fix self assignment issue with ancillary->mode Colin King
@ 2021-06-25 13:24 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-06-25 13:24 UTC (permalink / raw)
  To: linux-spi, Colin King; +Cc: Mark Brown, linux-kernel, kernel-janitors

On Wed, 23 Jun 2021 18:23:00 +0100, Colin King wrote:
> There is an assignment of ancillary->mode to itself which looks
> dubious since the proceeding comment states that the speed and
> mode is taken over from the SPI main device, indicating that
> ancillary->mode should assigned using the value spi->mode.
> Fix this.

Applied to

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

Thanks!

[1/1] spi: Fix self assignment issue with ancillary->mode
      commit: b01d550663fa5fd40a1785b0f1211fb657892edf

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

end of thread, other threads:[~2021-06-25 13:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 17:23 [PATCH][next] spi: Fix self assignment issue with ancillary->mode Colin King
2021-06-25 13:24 ` 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).