aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/libqos/i2c.c
diff options
context:
space:
mode:
authorAlexander Bulekov <alxndr@bu.edu>2020-02-19 23:11:05 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2020-02-22 08:26:48 +0000
commit39397a9a76eb02ad8a772f43446fdb3344093c35 (patch)
tree94dd083830e07cec1d3e11377aa0f9ad4594b6a9 /tests/qtest/libqos/i2c.c
parent0bd9aef89ba941b41773d9dbfa94433c2b7d00de (diff)
libqos: rename i2c_send and i2c_recv
The names i2c_send and i2c_recv collide with functions defined in hw/i2c/core.c. This causes an error when linking against libqos and softmmu simultaneously (for example when using qtest inproc). Rename the libqos functions to avoid this. Signed-off-by: Alexander Bulekov <alxndr@bu.edu> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Darren Kenny <darren.kenny@oracle.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-id: 20200220041118.23264-10-alxndr@bu.edu Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests/qtest/libqos/i2c.c')
-rw-r--r--tests/qtest/libqos/i2c.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/qtest/libqos/i2c.c b/tests/qtest/libqos/i2c.c
index 156114e745..38f800dbab 100644
--- a/tests/qtest/libqos/i2c.c
+++ b/tests/qtest/libqos/i2c.c
@@ -10,12 +10,12 @@
#include "libqos/i2c.h"
#include "libqtest.h"
-void i2c_send(QI2CDevice *i2cdev, const uint8_t *buf, uint16_t len)
+void qi2c_send(QI2CDevice *i2cdev, const uint8_t *buf, uint16_t len)
{
i2cdev->bus->send(i2cdev->bus, i2cdev->addr, buf, len);
}
-void i2c_recv(QI2CDevice *i2cdev, uint8_t *buf, uint16_t len)
+void qi2c_recv(QI2CDevice *i2cdev, uint8_t *buf, uint16_t len)
{
i2cdev->bus->recv(i2cdev->bus, i2cdev->addr, buf, len);
}
@@ -23,8 +23,8 @@ void i2c_recv(QI2CDevice *i2cdev, uint8_t *buf, uint16_t len)
void i2c_read_block(QI2CDevice *i2cdev, uint8_t reg,
uint8_t *buf, uint16_t len)
{
- i2c_send(i2cdev, &reg, 1);
- i2c_recv(i2cdev, buf, len);
+ qi2c_send(i2cdev, &reg, 1);
+ qi2c_recv(i2cdev, buf, len);
}
void i2c_write_block(QI2CDevice *i2cdev, uint8_t reg,
@@ -33,7 +33,7 @@ void i2c_write_block(QI2CDevice *i2cdev, uint8_t reg,
uint8_t *cmd = g_malloc(len + 1);
cmd[0] = reg;
memcpy(&cmd[1], buf, len);
- i2c_send(i2cdev, cmd, len + 1);
+ qi2c_send(i2cdev, cmd, len + 1);
g_free(cmd);
}