提交 4a1b3acc 编写于 作者: G Greg Kroah-Hartman

Staging: hv: remove RING_BUFFER typedef

typedefs are bad, kill them.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 8a0e1c55
......@@ -302,16 +302,16 @@ u32 GetRingBufferInterruptMask(struct hv_ring_buffer_info *rbi)
--*/
int RingBufferInit(struct hv_ring_buffer_info *RingInfo, void *Buffer, u32 BufferLen)
{
if (sizeof(RING_BUFFER) != PAGE_SIZE)
if (sizeof(struct hv_ring_buffer) != PAGE_SIZE)
return -EINVAL;
memset(RingInfo, 0, sizeof(struct hv_ring_buffer_info));
RingInfo->RingBuffer = (RING_BUFFER *)Buffer;
RingInfo->RingBuffer = (struct hv_ring_buffer *)Buffer;
RingInfo->RingBuffer->ReadIndex = RingInfo->RingBuffer->WriteIndex = 0;
RingInfo->RingSize = BufferLen;
RingInfo->RingDataSize = BufferLen - sizeof(RING_BUFFER);
RingInfo->RingDataSize = BufferLen - sizeof(struct hv_ring_buffer);
spin_lock_init(&RingInfo->ring_lock);
......
......@@ -27,7 +27,7 @@
#include <linux/scatterlist.h>
typedef struct _RING_BUFFER {
struct hv_ring_buffer {
/* Offset in bytes from the start of ring data below */
volatile u32 WriteIndex;
......@@ -51,10 +51,10 @@ typedef struct _RING_BUFFER {
* !!! DO NOT place any fields below this !!!
*/
u8 Buffer[0];
} __attribute__((packed)) RING_BUFFER;
} __attribute__((packed));
struct hv_ring_buffer_info {
RING_BUFFER *RingBuffer;
struct hv_ring_buffer *RingBuffer;
u32 RingSize; /* Include the shared header */
spinlock_t ring_lock;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册