Skip to content

Commit 1fdde16

Browse files
committed
hv: delete struct hv_dev_port_info
It's no longer needed, and the struct hv_ring_buffer_debug_info structure shouldn't be "global" so move it to the local .h file instead. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2c9be3e commit 1fdde16

File tree

3 files changed

+17
-42
lines changed

3 files changed

+17
-42
lines changed

drivers/hv/hyperv_vmbus.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,13 @@ struct hv_context {
514514

515515
extern struct hv_context hv_context;
516516

517+
struct hv_ring_buffer_debug_info {
518+
u32 current_interrupt_mask;
519+
u32 current_read_index;
520+
u32 current_write_index;
521+
u32 bytes_avail_toread;
522+
u32 bytes_avail_towrite;
523+
};
517524

518525
/* Hv Interface */
519526

drivers/hv/vmbus_drv.c

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ static struct completion probe_event;
4747
static int irq;
4848

4949
struct hv_device_info {
50-
struct hv_dev_port_info inbound;
51-
struct hv_dev_port_info outbound;
50+
struct hv_ring_buffer_debug_info inbound;
51+
struct hv_ring_buffer_debug_info outbound;
5252
};
5353

5454
static int vmbus_exists(void)
@@ -63,26 +63,11 @@ static int vmbus_exists(void)
6363
static void get_channel_info(struct hv_device *device,
6464
struct hv_device_info *info)
6565
{
66-
struct hv_ring_buffer_debug_info inbound;
67-
struct hv_ring_buffer_debug_info outbound;
68-
6966
if (!device->channel)
7067
return;
7168

72-
hv_ringbuffer_get_debuginfo(&device->channel->inbound, &inbound);
73-
hv_ringbuffer_get_debuginfo(&device->channel->outbound, &outbound);
74-
75-
info->inbound.int_mask = inbound.current_interrupt_mask;
76-
info->inbound.read_idx = inbound.current_read_index;
77-
info->inbound.write_idx = inbound.current_write_index;
78-
info->inbound.bytes_avail_toread = inbound.bytes_avail_toread;
79-
info->inbound.bytes_avail_towrite = inbound.bytes_avail_towrite;
80-
81-
info->outbound.int_mask = outbound.current_interrupt_mask;
82-
info->outbound.read_idx = outbound.current_read_index;
83-
info->outbound.write_idx = outbound.current_write_index;
84-
info->outbound.bytes_avail_toread = outbound.bytes_avail_toread;
85-
info->outbound.bytes_avail_towrite = outbound.bytes_avail_towrite;
69+
hv_ringbuffer_get_debuginfo(&device->channel->inbound, &info->inbound);
70+
hv_ringbuffer_get_debuginfo(&device->channel->outbound, &info->outbound);
8671
}
8772

8873
#define VMBUS_ALIAS_LEN ((sizeof((struct hv_vmbus_device_id *)0)->guid) * 2)
@@ -114,23 +99,23 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
11499
get_channel_info(hv_dev, device_info);
115100

116101
if (!strcmp(dev_attr->attr.name, "out_intr_mask")) {
117-
ret = sprintf(buf, "%d\n", device_info->outbound.int_mask);
102+
ret = sprintf(buf, "%d\n", device_info->outbound.current_interrupt_mask);
118103
} else if (!strcmp(dev_attr->attr.name, "out_read_index")) {
119-
ret = sprintf(buf, "%d\n", device_info->outbound.read_idx);
104+
ret = sprintf(buf, "%d\n", device_info->outbound.current_read_index);
120105
} else if (!strcmp(dev_attr->attr.name, "out_write_index")) {
121-
ret = sprintf(buf, "%d\n", device_info->outbound.write_idx);
106+
ret = sprintf(buf, "%d\n", device_info->outbound.current_write_index);
122107
} else if (!strcmp(dev_attr->attr.name, "out_read_bytes_avail")) {
123108
ret = sprintf(buf, "%d\n",
124109
device_info->outbound.bytes_avail_toread);
125110
} else if (!strcmp(dev_attr->attr.name, "out_write_bytes_avail")) {
126111
ret = sprintf(buf, "%d\n",
127112
device_info->outbound.bytes_avail_towrite);
128113
} else if (!strcmp(dev_attr->attr.name, "in_intr_mask")) {
129-
ret = sprintf(buf, "%d\n", device_info->inbound.int_mask);
114+
ret = sprintf(buf, "%d\n", device_info->inbound.current_interrupt_mask);
130115
} else if (!strcmp(dev_attr->attr.name, "in_read_index")) {
131-
ret = sprintf(buf, "%d\n", device_info->inbound.read_idx);
116+
ret = sprintf(buf, "%d\n", device_info->inbound.current_read_index);
132117
} else if (!strcmp(dev_attr->attr.name, "in_write_index")) {
133-
ret = sprintf(buf, "%d\n", device_info->inbound.write_idx);
118+
ret = sprintf(buf, "%d\n", device_info->inbound.current_write_index);
134119
} else if (!strcmp(dev_attr->attr.name, "in_read_bytes_avail")) {
135120
ret = sprintf(buf, "%d\n",
136121
device_info->inbound.bytes_avail_toread);

include/linux/hyperv.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -429,15 +429,6 @@ struct hv_ring_buffer_info {
429429
u32 ring_data_startoffset;
430430
};
431431

432-
struct hv_ring_buffer_debug_info {
433-
u32 current_interrupt_mask;
434-
u32 current_read_index;
435-
u32 current_write_index;
436-
u32 bytes_avail_toread;
437-
u32 bytes_avail_towrite;
438-
};
439-
440-
441432
/*
442433
*
443434
* hv_get_ringbuffer_availbytes()
@@ -1166,14 +1157,6 @@ extern int vmbus_recvpacket_raw(struct vmbus_channel *channel,
11661157

11671158
extern void vmbus_ontimer(unsigned long data);
11681159

1169-
struct hv_dev_port_info {
1170-
u32 int_mask;
1171-
u32 read_idx;
1172-
u32 write_idx;
1173-
u32 bytes_avail_toread;
1174-
u32 bytes_avail_towrite;
1175-
};
1176-
11771160
/* Base driver object */
11781161
struct hv_driver {
11791162
const char *name;

0 commit comments

Comments
 (0)