mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
do not cast void pointers
This commit is contained in:
parent
644352538d
commit
9efd4dc000
7 changed files with 41 additions and 41 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
int dft_parse(struct fpga_ip *c)
|
||||
{
|
||||
struct dft *dft = (struct dft *) &c->_vd;
|
||||
struct dft *dft = c->_vd;
|
||||
|
||||
config_setting_t *cfg_harms;
|
||||
|
||||
|
@ -48,7 +48,7 @@ int dft_start(struct fpga_ip *c)
|
|||
int ret;
|
||||
|
||||
struct fpga_card *f = c->card;
|
||||
struct dft *dft = (struct dft *) &c->_vd;
|
||||
struct dft *dft = c->_vd;
|
||||
|
||||
XHls_dft *xdft = &dft->inst;
|
||||
XHls_dft_Config xdft_cfg = {
|
||||
|
@ -78,7 +78,7 @@ int dft_start(struct fpga_ip *c)
|
|||
|
||||
int dft_stop(struct fpga_ip *c)
|
||||
{
|
||||
struct dft *dft = (struct dft *) &c->_vd;
|
||||
struct dft *dft = c->_vd;
|
||||
|
||||
XHls_dft *xdft = &dft->inst;
|
||||
|
||||
|
@ -89,7 +89,7 @@ int dft_stop(struct fpga_ip *c)
|
|||
|
||||
int dft_destroy(struct fpga_ip *c)
|
||||
{
|
||||
struct dft *dft = (struct dft *) &c->_vd;
|
||||
struct dft *dft = c->_vd;
|
||||
|
||||
if (dft->fharmonics) {
|
||||
free(dft->fharmonics);
|
||||
|
|
|
@ -100,7 +100,7 @@ int dma_ping_pong(struct fpga_ip *c, char *src, char *dst, size_t len)
|
|||
|
||||
int dma_write(struct fpga_ip *c, char *buf, size_t len)
|
||||
{
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
|
||||
|
@ -113,7 +113,7 @@ int dma_write(struct fpga_ip *c, char *buf, size_t len)
|
|||
|
||||
int dma_read(struct fpga_ip *c, char *buf, size_t len)
|
||||
{
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
|
||||
|
@ -126,7 +126,7 @@ int dma_read(struct fpga_ip *c, char *buf, size_t len)
|
|||
|
||||
int dma_read_complete(struct fpga_ip *c, char **buf, size_t *len)
|
||||
{
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
|
||||
|
@ -139,7 +139,7 @@ int dma_read_complete(struct fpga_ip *c, char **buf, size_t *len)
|
|||
|
||||
int dma_write_complete(struct fpga_ip *c, char **buf, size_t *len)
|
||||
{
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
|
||||
|
@ -154,7 +154,7 @@ int dma_sg_write(struct fpga_ip *c, char *buf, size_t len)
|
|||
{
|
||||
int ret, bdcnt;
|
||||
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
XAxiDma_BdRing *ring = XAxiDma_GetTxRing(xdma);
|
||||
|
@ -231,7 +231,7 @@ int dma_sg_read(struct fpga_ip *c, char *buf, size_t len)
|
|||
{
|
||||
int ret, bdcnt;
|
||||
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
XAxiDma_BdRing *ring = XAxiDma_GetRxRing(xdma);
|
||||
|
@ -299,7 +299,7 @@ out:
|
|||
|
||||
int dma_sg_write_complete(struct fpga_ip *c, char **buf, size_t *len)
|
||||
{
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
XAxiDma_BdRing *ring = XAxiDma_GetTxRing(xdma);
|
||||
|
@ -330,7 +330,7 @@ int dma_sg_write_complete(struct fpga_ip *c, char **buf, size_t *len)
|
|||
|
||||
int dma_sg_read_complete(struct fpga_ip *c, char **buf, size_t *len)
|
||||
{
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
XAxiDma_BdRing *ring = XAxiDma_GetRxRing(xdma);
|
||||
|
@ -384,7 +384,7 @@ int dma_sg_read_complete(struct fpga_ip *c, char **buf, size_t *len)
|
|||
|
||||
int dma_simple_read(struct fpga_ip *c, char *buf, size_t len)
|
||||
{
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
XAxiDma_BdRing *ring = XAxiDma_GetRxRing(xdma);
|
||||
|
@ -422,7 +422,7 @@ int dma_simple_read(struct fpga_ip *c, char *buf, size_t len)
|
|||
|
||||
int dma_simple_write(struct fpga_ip *c, char *buf, size_t len)
|
||||
{
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
XAxiDma_BdRing *ring = XAxiDma_GetTxRing(xdma);
|
||||
|
@ -461,7 +461,7 @@ int dma_simple_write(struct fpga_ip *c, char *buf, size_t len)
|
|||
|
||||
int dma_simple_read_complete(struct fpga_ip *c, char **buf, size_t *len)
|
||||
{
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
XAxiDma_BdRing *ring = XAxiDma_GetRxRing(xdma);
|
||||
|
@ -484,7 +484,7 @@ int dma_simple_read_complete(struct fpga_ip *c, char **buf, size_t *len)
|
|||
|
||||
int dma_simple_write_complete(struct fpga_ip *c, char **buf, size_t *len)
|
||||
{
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
XAxiDma_BdRing *ring = XAxiDma_GetTxRing(xdma);
|
||||
|
@ -563,7 +563,7 @@ static int dma_init_rings(XAxiDma *xdma, struct dma_mem *bd)
|
|||
int dma_start(struct fpga_ip *c)
|
||||
{
|
||||
int ret, sg;
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma *xdma = &dma->inst;
|
||||
|
||||
|
@ -618,7 +618,7 @@ int dma_start(struct fpga_ip *c)
|
|||
|
||||
int dma_reset(struct fpga_ip *c)
|
||||
{
|
||||
struct dma *dma = (struct dma *) &c->_vd;
|
||||
struct dma *dma = c->_vd;
|
||||
|
||||
XAxiDma_Reset(&dma->inst);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ int fifo_start(struct fpga_ip *c)
|
|||
int ret;
|
||||
|
||||
struct fpga_card *f = c->card;
|
||||
struct fifo *fifo = (struct fifo *) &c->_vd;
|
||||
struct fifo *fifo = c->_vd;
|
||||
|
||||
XLlFifo *xfifo = &fifo->inst;
|
||||
XLlFifo_Config fifo_cfg = {
|
||||
|
@ -41,7 +41,7 @@ int fifo_start(struct fpga_ip *c)
|
|||
|
||||
int fifo_stop(struct fpga_ip *c)
|
||||
{
|
||||
struct fifo *fifo = (struct fifo *) &c->_vd;
|
||||
struct fifo *fifo = c->_vd;
|
||||
|
||||
XLlFifo *xfifo = &fifo->inst;
|
||||
|
||||
|
@ -52,7 +52,7 @@ int fifo_stop(struct fpga_ip *c)
|
|||
|
||||
ssize_t fifo_write(struct fpga_ip *c, char *buf, size_t len)
|
||||
{
|
||||
struct fifo *fifo = (struct fifo *) &c->_vd;
|
||||
struct fifo *fifo = c->_vd;
|
||||
|
||||
XLlFifo *xllfifo = &fifo->inst;
|
||||
|
||||
|
@ -70,7 +70,7 @@ ssize_t fifo_write(struct fpga_ip *c, char *buf, size_t len)
|
|||
|
||||
ssize_t fifo_read(struct fpga_ip *c, char *buf, size_t len)
|
||||
{
|
||||
struct fifo *fifo = (struct fifo *) &c->_vd;
|
||||
struct fifo *fifo = c->_vd;
|
||||
|
||||
XLlFifo *xllfifo = &fifo->inst;
|
||||
|
||||
|
@ -93,7 +93,7 @@ ssize_t fifo_read(struct fpga_ip *c, char *buf, size_t len)
|
|||
|
||||
int fifo_parse(struct fpga_ip *c)
|
||||
{
|
||||
struct fifo *fifo = (struct fifo *) &c->_vd;
|
||||
struct fifo *fifo = c->_vd;
|
||||
|
||||
int baseaddr_axi4;
|
||||
|
||||
|
@ -107,7 +107,7 @@ int fifo_parse(struct fpga_ip *c)
|
|||
|
||||
int fifo_reset(struct fpga_ip *c)
|
||||
{
|
||||
struct fifo *fifo = (struct fifo *) &c->_vd;
|
||||
struct fifo *fifo = c->_vd;
|
||||
|
||||
XLlFifo_Reset(&fifo->inst);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ int intc_start(struct fpga_ip *c)
|
|||
int ret;
|
||||
|
||||
struct fpga_card *f = c->card;
|
||||
struct intc *intc = (struct intc *) &c->_vd;
|
||||
struct intc *intc = c->_vd;
|
||||
|
||||
uintptr_t base = (uintptr_t) f->map + c->baseaddr;
|
||||
|
||||
|
@ -64,7 +64,7 @@ int intc_start(struct fpga_ip *c)
|
|||
int intc_destroy(struct fpga_ip *c)
|
||||
{
|
||||
struct fpga_card *f = c->card;
|
||||
struct intc *intc = (struct intc *) &c->_vd;
|
||||
struct intc *intc = c->_vd;
|
||||
|
||||
vfio_pci_msi_deinit(&f->vfio_device, intc->efds);
|
||||
|
||||
|
@ -74,7 +74,7 @@ int intc_destroy(struct fpga_ip *c)
|
|||
int intc_enable(struct fpga_ip *c, uint32_t mask, int flags)
|
||||
{
|
||||
struct fpga_card *f = c->card;
|
||||
struct intc *intc = (struct intc *) &c->_vd;
|
||||
struct intc *intc = c->_vd;
|
||||
|
||||
uint32_t ier, imr;
|
||||
uintptr_t base = (uintptr_t) f->map + c->baseaddr;
|
||||
|
@ -124,7 +124,7 @@ int intc_disable(struct fpga_ip *c, uint32_t mask)
|
|||
uint64_t intc_wait(struct fpga_ip *c, int irq)
|
||||
{
|
||||
struct fpga_card *f = c->card;
|
||||
struct intc *intc = (struct intc *) &c->_vd;
|
||||
struct intc *intc = c->_vd;
|
||||
|
||||
uintptr_t base = (uintptr_t) f->map + c->baseaddr;
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ static int model_xsg_map_read(uint32_t *map, size_t len, void *baseaddr)
|
|||
|
||||
int model_parse(struct fpga_ip *c)
|
||||
{
|
||||
struct model *m = (struct model *) &c->_vd;
|
||||
struct model *m = c->_vd;
|
||||
struct model_param p;
|
||||
|
||||
config_setting_t *cfg_params, *cfg_param;
|
||||
|
@ -195,7 +195,7 @@ int model_init(struct fpga_ip *c)
|
|||
{
|
||||
int ret;
|
||||
|
||||
struct model *m = (struct model *) &c->_vd;
|
||||
struct model *m = c->_vd;
|
||||
|
||||
list_init(&m->parameters);
|
||||
list_init(&m->infos);
|
||||
|
@ -225,7 +225,7 @@ int model_init(struct fpga_ip *c)
|
|||
|
||||
int model_destroy(struct fpga_ip *c)
|
||||
{
|
||||
struct model *m = (struct model *) &c->_vd;
|
||||
struct model *m = c->_vd;
|
||||
|
||||
list_destroy(&m->parameters, (dtor_cb_t) model_param_destroy, true);
|
||||
list_destroy(&m->infos, (dtor_cb_t) model_info_destroy, true);
|
||||
|
@ -238,7 +238,7 @@ int model_destroy(struct fpga_ip *c)
|
|||
|
||||
void model_dump(struct fpga_ip *c)
|
||||
{
|
||||
struct model *m = (struct model *) &c->_vd;
|
||||
struct model *m = c->_vd;
|
||||
|
||||
const char *param_type[] = { "UFix", "Fix", "Float", "Boolean" };
|
||||
const char *parameter_dirs[] = { "In", "Out", "In/Out" };
|
||||
|
@ -329,7 +329,7 @@ int model_param_write(struct model_param *p, double v)
|
|||
|
||||
void model_param_add(struct fpga_ip *c, const char *name, enum model_param_direction dir, enum model_param_type type)
|
||||
{
|
||||
struct model *m = (struct model *) &c->_vd;
|
||||
struct model *m = c->_vd;
|
||||
struct model_param *p = alloc(sizeof(struct model_param));
|
||||
|
||||
p->name = strdup(name);
|
||||
|
@ -341,7 +341,7 @@ void model_param_add(struct fpga_ip *c, const char *name, enum model_param_direc
|
|||
|
||||
int model_param_remove(struct fpga_ip *c, const char *name)
|
||||
{
|
||||
struct model *m = (struct model *) &c->_vd;
|
||||
struct model *m = c->_vd;
|
||||
struct model_param *p;
|
||||
|
||||
p = list_lookup(&m->parameters, name);
|
||||
|
|
|
@ -19,7 +19,7 @@ int switch_start(struct fpga_ip *c)
|
|||
int ret;
|
||||
|
||||
struct fpga_card *f = c->card;
|
||||
struct sw *sw = (struct sw *) &c->_vd;
|
||||
struct sw *sw = c->_vd;
|
||||
|
||||
XAxis_Switch *xsw = &sw->inst;
|
||||
|
||||
|
@ -51,7 +51,7 @@ int switch_start(struct fpga_ip *c)
|
|||
int switch_init_paths(struct fpga_ip *c)
|
||||
{
|
||||
int ret;
|
||||
struct sw *sw = (struct sw *) &c->_vd;
|
||||
struct sw *sw = c->_vd;
|
||||
|
||||
XAxis_Switch *xsw = &sw->inst;
|
||||
|
||||
|
@ -80,7 +80,7 @@ int switch_init_paths(struct fpga_ip *c)
|
|||
|
||||
int switch_destroy(struct fpga_ip *c)
|
||||
{
|
||||
struct sw *sw = (struct sw *) &c->_vd;
|
||||
struct sw *sw = c->_vd;
|
||||
|
||||
list_destroy(&sw->paths, NULL, true);
|
||||
|
||||
|
@ -90,7 +90,7 @@ int switch_destroy(struct fpga_ip *c)
|
|||
int switch_parse(struct fpga_ip *c)
|
||||
{
|
||||
struct fpga_card *f = c->card;
|
||||
struct sw *sw = (struct sw *) &c->_vd;
|
||||
struct sw *sw = c->_vd;
|
||||
|
||||
list_init(&sw->paths);
|
||||
|
||||
|
@ -141,7 +141,7 @@ int switch_parse(struct fpga_ip *c)
|
|||
|
||||
int switch_connect(struct fpga_ip *c, struct fpga_ip *mi, struct fpga_ip *si)
|
||||
{
|
||||
struct sw *sw = (struct sw *) &c->_vd;
|
||||
struct sw *sw = c->_vd;
|
||||
XAxis_Switch *xsw = &sw->inst;
|
||||
|
||||
uint32_t mux, port;
|
||||
|
@ -177,7 +177,7 @@ int switch_connect(struct fpga_ip *c, struct fpga_ip *mi, struct fpga_ip *si)
|
|||
|
||||
int switch_disconnect(struct fpga_ip *c, struct fpga_ip *mi, struct fpga_ip *si)
|
||||
{
|
||||
struct sw *sw = (struct sw *) &c->_vd;
|
||||
struct sw *sw = c->_vd;
|
||||
XAxis_Switch *xsw = &sw->inst;
|
||||
|
||||
if (!XAxisScr_IsMiPortEnabled(xsw, mi->port, si->port))
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
int timer_start(struct fpga_ip *c)
|
||||
{
|
||||
struct fpga_card *f = c->card;
|
||||
struct timer *tmr = (struct timer *) &c->_vd;
|
||||
struct timer *tmr = c->_vd;
|
||||
|
||||
XTmrCtr *xtmr = &tmr->inst;
|
||||
XTmrCtr_Config xtmr_cfg = {
|
||||
|
|
Loading…
Add table
Reference in a new issue