From 46505c2670b77d8f8204580002bfa8fed75da88b Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Tue, 20 Oct 2026 14:54:01 +0300 Subject: [PATCH] kunit: Type the iSCSI TX fixture digest explicitly The TX fixture assigns an ordinary integer to the restricted __be32 ddigest field, producing a Sparse type warning. Production digest code stores little-endian CRC bytes in that field using an explicit __force cast, despite its declared type. Initialize the arbitrary test digest with cpu_to_le32 and the same cast. This keeps its bytes unchanged on little-endian hosts and consistent on big-endian hosts. The tests exercise send progress and offsets, not CRC calculation or the contents of this placeholder. --- iscsi-scst/kernel/kunit/suites/iscsi_tx_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iscsi-scst/kernel/kunit/suites/iscsi_tx_test.c b/iscsi-scst/kernel/kunit/suites/iscsi_tx_test.c index 9b0ed3d9f..5e8c91240 100644 --- a/iscsi-scst/kernel/kunit/suites/iscsi_tx_test.c +++ b/iscsi-scst/kernel/kunit/suites/iscsi_tx_test.c @@ -102,7 +102,7 @@ static int iscsi_tx_test_init(struct kunit *test) f->conn.wr_task = current; #endif f->rsp.conn = &f->conn; - f->rsp.ddigest = 0x12345678; + f->rsp.ddigest = (__force __be32)cpu_to_le32(0x12345678); kunit_activate_static_stub(test, write_data, iscsi_tx_write_stub); kunit_activate_static_stub(test, iscsi_tx_sendmsg, iscsi_tx_send_stub); kunit_activate_static_stub(test, iscsi_tx_complete, iscsi_tx_complete_stub);