Skip to content

Commit c113573

Browse files
authored
netvsp: rename internal struct (#293)
The `send_indirection_msg` struct is not following Rust conventions. Rename it to make rust-analyzer stop emitting a warning at random times. (It seems like rustc itself doesn't warn because the struct is `repr(C)`. This is weird.)
1 parent 0445492 commit c113573

File tree

1 file changed

+4
-5
lines changed
  • vm/devices/net/netvsp/src

1 file changed

+4
-5
lines changed

vm/devices/net/netvsp/src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2452,17 +2452,16 @@ impl<T: RingMem> NetChannel<T> {
24522452

24532453
#[repr(C)]
24542454
#[derive(AsBytes)]
2455-
struct send_indirection_msg {
2455+
struct SendIndirectionMsg {
24562456
pub message: protocol::Message5SendIndirectionTable,
24572457
pub send_indirection_table:
24582458
[u32; VMS_SWITCH_RSS_MAX_SEND_INDIRECTION_TABLE_ENTRIES as usize],
24592459
}
24602460

24612461
// The offset to the send indirection table from the beginning of the NVSP message.
2462-
let send_indirection_table_offset =
2463-
offset_of!(send_indirection_msg, send_indirection_table)
2464-
+ size_of::<protocol::MessageHeader>();
2465-
let mut data = send_indirection_msg {
2462+
let send_indirection_table_offset = offset_of!(SendIndirectionMsg, send_indirection_table)
2463+
+ size_of::<protocol::MessageHeader>();
2464+
let mut data = SendIndirectionMsg {
24662465
message: protocol::Message5SendIndirectionTable {
24672466
table_entry_count: VMS_SWITCH_RSS_MAX_SEND_INDIRECTION_TABLE_ENTRIES,
24682467
table_offset: send_indirection_table_offset as u32,

0 commit comments

Comments
 (0)