mirror of
https://github.com/SCST-project/scst.git
synced 2026-10-22 06:02:33 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user