* [PATCH] spi: loopback-test: fix up const pointer issue in rx_ranges_cmp()
@ 2025-05-22 10:59 Greg Kroah-Hartman
2025-05-22 13:38 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2025-05-22 10:59 UTC (permalink / raw)
To: linux-spi; +Cc: linux-kernel, Greg Kroah-Hartman, Mark Brown
When a list head is a const pointer, the list entry for that head also
must remain a const pointer, otherwise we are just "throwing it away"
for no good reason. Fix this up by properly marking these structures as
const.
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/spi/spi-loopback-test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c
index 31a878d9458d..0389fce5b1f2 100644
--- a/drivers/spi/spi-loopback-test.c
+++ b/drivers/spi/spi-loopback-test.c
@@ -494,8 +494,8 @@ struct rx_ranges {
static int rx_ranges_cmp(void *priv, const struct list_head *a,
const struct list_head *b)
{
- struct rx_ranges *rx_a = list_entry(a, struct rx_ranges, list);
- struct rx_ranges *rx_b = list_entry(b, struct rx_ranges, list);
+ const struct rx_ranges *rx_a = list_entry(a, struct rx_ranges, list);
+ const struct rx_ranges *rx_b = list_entry(b, struct rx_ranges, list);
if (rx_a->start > rx_b->start)
return 1;
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: loopback-test: fix up const pointer issue in rx_ranges_cmp()
2025-05-22 10:59 [PATCH] spi: loopback-test: fix up const pointer issue in rx_ranges_cmp() Greg Kroah-Hartman
@ 2025-05-22 13:38 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-05-22 13:38 UTC (permalink / raw)
To: linux-spi, Greg Kroah-Hartman; +Cc: linux-kernel
On Thu, 22 May 2025 12:59:14 +0200, Greg Kroah-Hartman wrote:
> When a list head is a const pointer, the list entry for that head also
> must remain a const pointer, otherwise we are just "throwing it away"
> for no good reason. Fix this up by properly marking these structures as
> const.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: loopback-test: fix up const pointer issue in rx_ranges_cmp()
commit: e7f3d11567c2c79c4342791ba91c500b434ce147
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:[~2025-05-22 13:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22 10:59 [PATCH] spi: loopback-test: fix up const pointer issue in rx_ranges_cmp() Greg Kroah-Hartman
2025-05-22 13:38 ` 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).