Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

virtio: cstyle/lint cleanups

  • Loading branch information...
commit 0e6a5ffd0ea4f00244cf5d658df738bef9818459 1 parent 2eae49c
Alexey Zaytsev xl0 authored
Showing with 18 additions and 16 deletions.
  1. +11 −9 virtio/virtio.c
  2. +7 −7 virtio/virtiovar.h
20 virtio/virtio.c
View
@@ -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 */
@@ -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;
@@ -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);
}
@@ -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
14 virtio/virtiovar.h
View
@@ -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 {
@@ -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,
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.