From 98c8f9a071d13b362e24b0ca4b3c4af834ec956f Mon Sep 17 00:00:00 2001 From: Felipe Franciosi Date: Thu, 5 Sep 2019 15:47:00 +0100 Subject: Minor style fixes --- lib/dma.h | 2 +- lib/libmuser.c | 30 +++++++++++++++--------------- lib/muser.h | 14 +++++++------- 3 files changed, 23 insertions(+), 23 deletions(-) (limited to 'lib') diff --git a/lib/dma.h b/lib/dma.h index 752f32b..d9de811 100644 --- a/lib/dma.h +++ b/lib/dma.h @@ -236,6 +236,6 @@ dma_unmap_addr(lm_ctx_t * const ctx, dma_controller_t * dma, dma_unmap_sg(dma, &sg, &iov, 1); } -#endif /* DMA_DMA_H */ +#endif /* DMA_DMA_H */ /* ex: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lib/libmuser.c b/lib/libmuser.c index 29a4375..0660511 100644 --- a/lib/libmuser.c +++ b/lib/libmuser.c @@ -60,11 +60,11 @@ typedef enum { } irq_type_t; typedef struct { - irq_type_t type; /* irq type this device is using */ - int err_efd; /* eventfd for irq err */ - int req_efd; /* eventfd for irq req */ - uint32_t max_ivs; /* maximum number of ivs supported */ - int efds[0]; /* XXX must be last */ + irq_type_t type; /* irq type this device is using */ + int err_efd; /* eventfd for irq err */ + int req_efd; /* eventfd for irq req */ + uint32_t max_ivs; /* maximum number of ivs supported */ + int efds[0]; /* XXX must be last */ } lm_irqs_t; /* @@ -76,24 +76,24 @@ typedef struct { #t " " #m " must be last member in " #s) struct lm_ctx { - void *pvt; - dma_controller_t *dma; - int fd; + void *pvt; + dma_controller_t *dma; + int fd; bool extended; int (*reset) (void *pvt); - lm_log_lvl_t log_lvl; - lm_log_fn_t *log; + lm_log_lvl_t log_lvl; + lm_log_fn_t *log; lm_pci_info_t pci_info; - lm_pci_config_space_t *pci_config_space; + lm_pci_config_space_t *pci_config_space; struct caps *caps; - lm_irqs_t irqs; /* XXX must be last */ + lm_irqs_t irqs; /* XXX must be last */ }; MUST_BE_LAST(struct lm_ctx, irqs, lm_irqs_t); #define LM2VFIO_IRQT(type) (type - 1) void lm_log(const lm_ctx_t * const ctx, const lm_log_lvl_t lvl, - const char *const fmt, ...) + const char *const fmt, ...) { va_list ap; char buf[BUFSIZ]; @@ -741,7 +741,7 @@ lm_access(lm_ctx_t * const lm_ctx, char *buf, size_t count, lm_log(lm_ctx, LM_ERR, "failed to %s %llx@%lx: %s\n", is_write ? "write" : "read", size, *ppos, strerror(-ret)); return -EFAULT; - } + } count -= size; done += size; *ppos += size; @@ -1100,7 +1100,7 @@ lm_ctx_create(lm_dev_info_t * const dev_info) err = copy_sparse_mmap_areas(lm_ctx->pci_info.reg_info, dev_info->pci_info.reg_info); if (err) - goto out; + goto out; lm_ctx->fd = dev_attach(dev_info->uuid); if (lm_ctx->fd == -1) { diff --git a/lib/muser.h b/lib/muser.h index 0a3432a..4b453f0 100644 --- a/lib/muser.h +++ b/lib/muser.h @@ -57,8 +57,8 @@ typedef struct lm_ctx lm_ctx_t; #define LM_REG_FLAG_MEM (1 << 3) // if unset, bar is IO struct lm_mmap_area { - uint64_t start; - uint64_t size; + uint64_t start; + uint64_t size; }; struct lm_sparse_mmap_areas { @@ -163,7 +163,7 @@ typedef struct { * Per-region information. Only supported regions need to be defined, * unsupported regions should be left to 0. */ - lm_reg_info_t reg_info[LM_DEV_NUM_REGS]; + lm_reg_info_t reg_info[LM_DEV_NUM_REGS]; /* * Device and vendor ID. @@ -250,7 +250,7 @@ typedef struct { /* * Private data passed to various lm_XXX functions. */ - void *pvt; + void *pvt; /* * Whether an extended PCI configuration space should be created. @@ -260,17 +260,17 @@ typedef struct { /* * Function to call for logging. Optional. */ - lm_log_fn_t *log; + lm_log_fn_t *log; /* * Log level. Messages above this level are not logged. Optional */ - lm_log_lvl_t log_lvl; + lm_log_lvl_t log_lvl; /* * PCI configuration. */ - lm_pci_info_t pci_info; + lm_pci_info_t pci_info; /* * Function that is called when the guest resets the device. Optional. -- cgit v1.1