diff --git a/plugins/synapticsmst/meson.build b/plugins/synapticsmst/meson.build index 25543811a..f557fb4b6 100644 --- a/plugins/synapticsmst/meson.build +++ b/plugins/synapticsmst/meson.build @@ -19,10 +19,6 @@ shared_module('fu_plugin_synapticsmst', dependencies : [ plugin_deps, ], - # https://github.com/hughsie/fwupd/issues/207 - override_options : [ - 'werror=false', - ] ) if get_option('tests') @@ -53,10 +49,6 @@ if get_option('tests') c_args : [ cargs, ], - # https://github.com/hughsie/fwupd/issues/207 - override_options : [ - 'werror=false', - ] ) test('synapticsmst-self-test', e, env: ['FWUPD_LOCALSTATEDIR=/tmp/fwupd-self-test/var']) diff --git a/plugins/synapticsmst/synapticsmst-common.c b/plugins/synapticsmst/synapticsmst-common.c index 64977c66c..b6887f8cb 100644 --- a/plugins/synapticsmst/synapticsmst-common.c +++ b/plugins/synapticsmst/synapticsmst-common.c @@ -31,7 +31,7 @@ struct _SynapticsMSTConnection { guint8 synapticsmst_common_aux_node_read (SynapticsMSTConnection *connection, - gint offset, gint *buf, gint length) + guint32 offset, guint8 *buf, gint length) { if (lseek (connection->fd, offset, SEEK_SET) != offset) return DPCD_SEEK_FAIL; @@ -44,7 +44,7 @@ synapticsmst_common_aux_node_read (SynapticsMSTConnection *connection, static guint8 synapticsmst_common_aux_node_write (SynapticsMSTConnection *connection, - gint offset, const gint *buf, gint length) + guint32 offset, const guint8 *buf, gint length) { if (lseek (connection->fd, offset, SEEK_SET) != offset) return DPCD_SEEK_FAIL; @@ -74,7 +74,7 @@ synapticsmst_common_new (gint fd, guint8 layer, guint rad) guint8 synapticsmst_common_read_dpcd (SynapticsMSTConnection *connection, - gint offset, gint *buf, gint length) + guint32 offset, guint8 *buf, guint32 length) { if (connection->layer && connection->remain_layer) { guint8 rc, node; @@ -92,9 +92,9 @@ synapticsmst_common_read_dpcd (SynapticsMSTConnection *connection, guint8 synapticsmst_common_write_dpcd (SynapticsMSTConnection *connection, - gint offset, - const gint *buf, - gint length) + guint32 offset, + const guint8 *buf, + guint32 length) { if (connection->layer && connection->remain_layer) { guint8 rc, node; @@ -112,14 +112,14 @@ synapticsmst_common_write_dpcd (SynapticsMSTConnection *connection, guint8 synapticsmst_common_rc_set_command (SynapticsMSTConnection *connection, - gint rc_cmd, - gint length, - gint offset, + guint32 rc_cmd, + guint32 length, + guint32 offset, const guint8 *buf) { guint8 rc = 0; - gint cur_offset = offset; - gint cur_length; + guint32 cur_offset = offset; + guint32 cur_length; gint data_left = length; gint cmd; gint readData = 0; @@ -135,21 +135,21 @@ synapticsmst_common_rc_set_command (SynapticsMSTConnection *connection, if (cur_length) { /* write data */ - rc = synapticsmst_common_write_dpcd (connection, REG_RC_DATA, (gint *)buf, cur_length); + rc = synapticsmst_common_write_dpcd (connection, REG_RC_DATA, buf, cur_length); if (rc) break; /* write offset */ rc = synapticsmst_common_write_dpcd (connection, REG_RC_OFFSET, - &cur_offset, 4); + (guint8 *)&cur_offset, 4); if (rc) break; /* write length */ rc = synapticsmst_common_write_dpcd (connection, REG_RC_LEN, - &cur_length, 4); + (guint8 *)&cur_length, 4); if (rc) break; } @@ -158,7 +158,7 @@ synapticsmst_common_rc_set_command (SynapticsMSTConnection *connection, cmd = 0x80 | rc_cmd; rc = synapticsmst_common_write_dpcd (connection, REG_RC_CMD, - &cmd, 1); + (guint8 *)&cmd, 1); if (rc) break; @@ -169,7 +169,7 @@ synapticsmst_common_rc_set_command (SynapticsMSTConnection *connection, do { rc = synapticsmst_common_read_dpcd (connection, REG_RC_CMD, - &readData, 2); + (guint8 *)&readData, 2); clock_gettime (CLOCK_REALTIME, &t_spec); if (t_spec.tv_sec > deadline) { rc = -1; @@ -193,17 +193,17 @@ synapticsmst_common_rc_set_command (SynapticsMSTConnection *connection, guint8 synapticsmst_common_rc_get_command (SynapticsMSTConnection *connection, - gint rc_cmd, - gint length, - gint offset, + guint32 rc_cmd, + guint32 length, + guint32 offset, guint8 *buf) { guint8 rc = 0; - gint cur_offset = offset; - gint cur_length; + guint32 cur_offset = offset; + guint32 cur_length; gint data_need = length; - gint cmd; - gint readData = 0; + guint32 cmd; + guint32 readData = 0; long deadline; struct timespec t_spec; @@ -218,14 +218,14 @@ synapticsmst_common_rc_get_command (SynapticsMSTConnection *connection, /* write offset */ rc = synapticsmst_common_write_dpcd (connection, REG_RC_OFFSET, - &cur_offset, 4); + (guint8 *)&cur_offset, 4); if (rc) break; /* write length */ rc = synapticsmst_common_write_dpcd (connection, REG_RC_LEN, - &cur_length, 4); + (guint8 *)&cur_length, 4); if (rc) break; } @@ -234,7 +234,7 @@ synapticsmst_common_rc_get_command (SynapticsMSTConnection *connection, cmd = 0x80 | rc_cmd; rc = synapticsmst_common_write_dpcd (connection, REG_RC_CMD, - &cmd, 1); + (guint8 *)&cmd, 1); if (rc) break; @@ -245,7 +245,7 @@ synapticsmst_common_rc_get_command (SynapticsMSTConnection *connection, do { rc = synapticsmst_common_read_dpcd (connection, REG_RC_CMD, - &readData, 2); + (guint8 *)&readData, 2); clock_gettime (CLOCK_REALTIME, &t_spec); if (t_spec.tv_sec > deadline) { rc = -1; @@ -262,7 +262,7 @@ synapticsmst_common_rc_get_command (SynapticsMSTConnection *connection, if (cur_length) { rc = synapticsmst_common_read_dpcd (connection, REG_RC_DATA, - (gint *)buf, + buf, cur_length); if (rc) break; @@ -278,16 +278,16 @@ synapticsmst_common_rc_get_command (SynapticsMSTConnection *connection, guint8 synapticsmst_common_rc_special_get_command (SynapticsMSTConnection *connection, - gint rc_cmd, - gint cmd_length, - gint cmd_offset, + guint32 rc_cmd, + guint32 cmd_length, + guint32 cmd_offset, guint8 *cmd_data, - gint length, + guint32 length, guint8 *buf) { guint8 rc = 0; - gint readData = 0; - gint cmd; + guint32 readData = 0; + guint32 cmd; long deadline; struct timespec t_spec; @@ -296,7 +296,7 @@ synapticsmst_common_rc_special_get_command (SynapticsMSTConnection *connection, if (cmd_data != NULL) { rc = synapticsmst_common_write_dpcd (connection, REG_RC_DATA, - (gint *)cmd_data, + cmd_data, cmd_length); if (rc) return rc; @@ -305,21 +305,21 @@ synapticsmst_common_rc_special_get_command (SynapticsMSTConnection *connection, /* write offset */ rc = synapticsmst_common_write_dpcd (connection, REG_RC_OFFSET, - &cmd_offset, 4); + (guint8 *)&cmd_offset, 4); if (rc) return rc; /* write length */ rc = synapticsmst_common_write_dpcd (connection, REG_RC_LEN, - &cmd_length, 4); + (guint8 *)&cmd_length, 4); if (rc) return rc; } /* send command */ cmd = 0x80 | rc_cmd; - rc = synapticsmst_common_write_dpcd (connection, REG_RC_CMD, &cmd, 1); + rc = synapticsmst_common_write_dpcd (connection, REG_RC_CMD, (guint8 *)&cmd, 1); if (rc) return rc; @@ -329,7 +329,7 @@ synapticsmst_common_rc_special_get_command (SynapticsMSTConnection *connection, do { rc = synapticsmst_common_read_dpcd (connection, REG_RC_CMD, - &readData, 2); + (guint8 *)&readData, 2); clock_gettime (CLOCK_REALTIME, &t_spec); if (t_spec.tv_sec > deadline) return -1; @@ -345,7 +345,7 @@ synapticsmst_common_rc_special_get_command (SynapticsMSTConnection *connection, if (length) { rc = synapticsmst_common_read_dpcd (connection, REG_RC_DATA, - (gint *)buf, length); + buf, length); if (rc) return rc; } diff --git a/plugins/synapticsmst/synapticsmst-common.h b/plugins/synapticsmst/synapticsmst-common.h index 69d2bdd8a..c2d3d27cd 100644 --- a/plugins/synapticsmst/synapticsmst-common.h +++ b/plugins/synapticsmst/synapticsmst-common.h @@ -67,39 +67,39 @@ SynapticsMSTConnection *synapticsmst_common_new (gint fd, guint rad); guint8 synapticsmst_common_aux_node_read (SynapticsMSTConnection *connection, - gint offset, - gint *buf, - gint length); + guint32 offset, + guint8 *buf, + gint length); guint8 synapticsmst_common_read_dpcd (SynapticsMSTConnection *connection, - gint offset, - gint *buf, - gint length); + guint32 offset, + guint8 *buf, + guint32 length); guint8 synapticsmst_common_write_dpcd (SynapticsMSTConnection *connection, - gint offset, - const gint *buf, - gint length); + guint32 offset, + const guint8 *buf, + guint32 length); guint8 synapticsmst_common_rc_set_command (SynapticsMSTConnection *connection, - gint rc_cmd, - gint length, - gint offset, + guint32 rc_cmd, + guint32 length, + guint32 offset, const guint8 *buf); guint8 synapticsmst_common_rc_get_command (SynapticsMSTConnection *connection, - gint rc_cmd, - gint length, - gint offset, - guint8 *buf); + guint32 rc_cmd, + guint32 length, + guint32 offset, + guint8 *buf); guint8 synapticsmst_common_rc_special_get_command (SynapticsMSTConnection *connection, - gint rc_cmd, - gint cmd_length, - gint cmd_offset, - guint8 *cmd_data, - gint length, - guint8 *buf); + guint32 rc_cmd, + guint32 cmd_length, + guint32 cmd_offset, + guint8 *cmd_data, + guint32 length, + guint8 *buf); guint8 synapticsmst_common_enable_remote_control (SynapticsMSTConnection *connection); diff --git a/plugins/synapticsmst/synapticsmst-device.c b/plugins/synapticsmst/synapticsmst-device.c index 29600620e..7446f281f 100644 --- a/plugins/synapticsmst/synapticsmst-device.c +++ b/plugins/synapticsmst/synapticsmst-device.c @@ -275,10 +275,10 @@ synapticsmst_device_scan_cascade_device (SynapticsMSTDevice *device, } connection = synapticsmst_common_new (priv->fd, layer, rad); - rc = synapticsmst_common_read_dpcd (connection, REG_RC_CAP, (gint *)byte, 1); + rc = synapticsmst_common_read_dpcd (connection, REG_RC_CAP, byte, 1); if (rc == DPCD_SUCCESS ) { if (byte[0] & 0x04) { - synapticsmst_common_read_dpcd (connection, REG_VENDOR_ID, (gint *)byte, 3); + synapticsmst_common_read_dpcd (connection, REG_VENDOR_ID, byte, 3); if (byte[0] == 0x90 && byte[1] == 0xCC && byte[2] == 0x24) priv->has_cascade = TRUE; } @@ -488,7 +488,7 @@ synapticsmst_device_enumerate_device (SynapticsMSTDevice *device, connection = synapticsmst_common_new (priv->fd, priv->layer, priv->rad); rc = synapticsmst_common_read_dpcd (connection, REG_FIRMWARE_VERSION, - (gint *)byte, 3); + byte, 3); if (rc) { g_set_error_literal (error, G_IO_ERROR, @@ -507,7 +507,7 @@ synapticsmst_device_enumerate_device (SynapticsMSTDevice *device, /* read board chip_id */ rc = synapticsmst_common_read_dpcd (connection, REG_CHIP_ID, - (gint *)byte, 2); + byte, 2); if (rc) { g_set_error_literal (error, G_IO_ERROR, @@ -588,7 +588,7 @@ synapticsmst_device_get_cascade (SynapticsMSTDevice *device) static gboolean synapticsmst_device_get_flash_checksum (SynapticsMSTDevice *device, - gint length, gint offset, + guint32 length, guint32 offset, guint32 *checksum, GError **error) { SynapticsMSTDevicePrivate *priv = GET_PRIVATE (device); @@ -1549,11 +1549,11 @@ synapticsmst_device_open (SynapticsMSTDevice *device, GError **error) } connection = synapticsmst_common_new (priv->fd, 0, 0); - if (synapticsmst_common_aux_node_read (connection, REG_RC_CAP, (gint *)byte, 1) == DPCD_SUCCESS) { + if (synapticsmst_common_aux_node_read (connection, REG_RC_CAP, byte, 1) == DPCD_SUCCESS) { if (byte[0] & 0x04) { synapticsmst_common_aux_node_read (connection, REG_VENDOR_ID, - (gint *)byte, 3); + byte, 3); if (byte[0] == 0x90 && byte[1] == 0xCC && byte[2] == 0x24) return TRUE; }