Skip to content

Commit e7f3d11

Browse files
gregkhbroonie
authored andcommitted
spi: loopback-test: fix up const pointer issue in rx_ranges_cmp()
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> Link: https://patch.msgid.link/2025052213-semifinal-sublevel-d631@gregkh Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2712a7d commit e7f3d11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi-loopback-test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,8 @@ struct rx_ranges {
494494
static int rx_ranges_cmp(void *priv, const struct list_head *a,
495495
const struct list_head *b)
496496
{
497-
struct rx_ranges *rx_a = list_entry(a, struct rx_ranges, list);
498-
struct rx_ranges *rx_b = list_entry(b, struct rx_ranges, list);
497+
const struct rx_ranges *rx_a = list_entry(a, struct rx_ranges, list);
498+
const struct rx_ranges *rx_b = list_entry(b, struct rx_ranges, list);
499499

500500
if (rx_a->start > rx_b->start)
501501
return 1;

0 commit comments

Comments
 (0)