From: Greg Kroah-Hartman Date: Thu, 22 May 2025 10:59:14 +0000 (+0200) Subject: spi: loopback-test: fix up const pointer issue in rx_ranges_cmp() X-Git-Tag: v6.16-rc1~166^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7f3d11567c2c79c4342791ba91c500b434ce147;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/2025052213-semifinal-sublevel-d631@gregkh Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c index 369cdb707fada..f02d56fd917d1 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;