Skip to content

Commit

Permalink
virtio: cstyle/lint cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
xl0 committed Sep 28, 2011
1 parent 2eae49c commit 0e6a5ff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
20 changes: 11 additions & 9 deletions virtio/virtio.c
Expand Up @@ -253,10 +253,11 @@ virtio_start_vq_intr(struct virtqueue *vq)
static ddi_dma_attr_t virtio_vq_dma_attr = {
DMA_ATTR_V0, /* Version number */
0, /* low address */
0x00000FFFFFFFFFFF, /*
* high address. Has to fit into 32 bits
* after page-shifting
*/
/*
* high address. Has to fit into 32 bits
* after page-shifting
*/
0x00000FFFFFFFFFFF,
0xFFFFFFFF, /* counter register max */
VIRTIO_PAGE_SIZE, /* page alignment required */
0x3F, /* burst sizes: 1 - 32 */
Expand Down Expand Up @@ -373,7 +374,8 @@ virtio_alloc_indirect(struct virtio_softc *sc, struct vq_entry *entry)
static int
virtio_init_vq(struct virtio_softc *sc, struct virtqueue *vq)
{
int i, ret;
int ret;
uint16_t i;
int vq_size = vq->vq_num;
int indirect_num = vq->vq_indirect_num;

Expand Down Expand Up @@ -753,14 +755,14 @@ virtio_ve_sync_desc(struct vq_entry *qe, unsigned int direction)
/* Sync the descriptor */
/* (The descriptor array is located at the start of the vq memory) */
(void) ddi_dma_sync(vq->vq_dma_handle,
sizeof(struct vring_desc) * qe->qe_index,
sizeof(struct vring_desc),
sizeof (struct vring_desc) * qe->qe_index,
sizeof (struct vring_desc),
direction);

/* Sync the indirect descriptors as well */
if (qe->qe_indirect_next)
(void) ddi_dma_sync(qe->qe_indirect_dma_handle,
0, sizeof(struct vring_desc) * qe->qe_indirect_next,
0, sizeof (struct vring_desc) * qe->qe_indirect_next,
direction);
}

Expand All @@ -786,7 +788,7 @@ virtio_push_chain(struct vq_entry *qe, boolean_t sync)

/* Bind the indirect descriptors */
if (qe->qe_indirect_next > 1) {
int i = 0;
uint16_t i = 0;

/*
* Set the pointer/flags to the
Expand Down
14 changes: 7 additions & 7 deletions virtio/virtiovar.h
Expand Up @@ -82,11 +82,11 @@
typedef boolean_t bool;
#define __packed __attribute__((packed))

#define QE_POISON1_FREE 0x1234111112341111ULL
#define QE_POISON1_USED 0x4321111143211111ULL
#define QE_POISON1_FREE 0x1234111112341111ULL
#define QE_POISON1_USED 0x4321111143211111ULL

#define QE_POISON2_FREE 0x1234222212342222ULL
#define QE_POISON2_USED 0x4321222243212222ULL
#define QE_POISON2_FREE 0x1234222212342222ULL
#define QE_POISON2_USED 0x4321222243212222ULL


struct vq_entry {
Expand Down Expand Up @@ -180,7 +180,7 @@ uint32_t virtio_read_device_config_4(struct virtio_softc *sc,
uint64_t virtio_read_device_config_8(struct virtio_softc *sc,
unsigned int index);
void virtio_write_device_config_1(struct virtio_softc *sc,
unsigned int index, uint8_t value );
unsigned int index, uint8_t value);
void virtio_write_device_config_2(struct virtio_softc *sc,
unsigned int index, uint16_t value);
void virtio_write_device_config_4(struct virtio_softc *sc,
Expand All @@ -202,8 +202,8 @@ void virtio_start_vq_intr(struct virtqueue *);

void virtio_ve_add_cookie(struct vq_entry *qe, ddi_dma_handle_t dma_handle,
ddi_dma_cookie_t dma_cookie, unsigned int ncookies, boolean_t write);
void virtio_ve_add_indirect_buf(struct vq_entry *qe, uint64_t paddr, uint32_t len,
boolean_t write);
void virtio_ve_add_indirect_buf(struct vq_entry *qe, uint64_t paddr,
uint32_t len, boolean_t write);
void virtio_ve_set(struct vq_entry *qe, uint64_t paddr, uint32_t len,
boolean_t write);

Expand Down

0 comments on commit 0e6a5ff

Please sign in to comment.