forked from Minki/linux
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: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
8a0e1c5505
commit
4a1b3acc90
@ -302,16 +302,16 @@ Description:
|
||||
--*/
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user