Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Drivers: hv: Simplify data structures for VMBus channel close message

struct vmbus_close_msg is used for sending the VMBus channel close
message. It contains a struct vmbus_channel_msginfo, which has a
flex array member at the end. The latter's presence in the middle
of struct vmbus_close_msg causes warnings when built with
-Wflex-array-member-not-at-end.

But the struct vmbus_channel_msginfo is unused because the Hyper-V host
does not send a response to the channel close message. So remove the
struct vmbus_channel_msginfo. Then, since the only remaining field is
struct vmbus_channel_close_channel, also remove the containing struct
vmbus_close_msg and directly use struct vmbus_channel_close_channel.
Besides eliminating unnecessary complexity, these changes resolve the
-Wflex-array-member-not-at-end warnings.

Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Reviewed-by: Tianyu Lan <tiala@microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>

authored by

Michael Kelley and committed by
Wei Liu
2d0ddbb6 ac7b0a5c

+2 -7
+1 -1
drivers/hv/channel.c
··· 925 925 926 926 /* Send a closing message */ 927 927 928 - msg = &channel->close_msg.msg; 928 + msg = &channel->close_msg; 929 929 930 930 msg->header.msgtype = CHANNELMSG_CLOSECHANNEL; 931 931 msg->child_relid = channel->offermsg.child_relid;
+1 -6
include/linux/hyperv.h
··· 707 707 unsigned char msg[]; 708 708 }; 709 709 710 - struct vmbus_close_msg { 711 - struct vmbus_channel_msginfo info; 712 - struct vmbus_channel_close_channel msg; 713 - }; 714 - 715 710 enum vmbus_device_type { 716 711 HV_IDE = 0, 717 712 HV_SCSI, ··· 795 800 struct hv_ring_buffer_info outbound; /* send to parent */ 796 801 struct hv_ring_buffer_info inbound; /* receive from parent */ 797 802 798 - struct vmbus_close_msg close_msg; 803 + struct vmbus_channel_close_channel close_msg; 799 804 800 805 /* Statistics */ 801 806 u64 interrupts; /* Host to Guest interrupts */