diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2022-05-03 07:57:47 +0900 |
---|---|---|
committer | 坂本 貴史 <o-takashi@sakamocchi.jp> | 2022-05-03 08:31:29 +0900 |
commit | 1883ea805f5c609e08fa642be9c1d344ee66031b (patch) | |
tree | aec63ea35a514f0894171f410f7ac640ce0f4e23 | |
parent | 1692b43bae2dcb5b8abe792fece08d90eea464a7 (diff) | |
download | libhinoko-1883ea805f5c609e08fa642be9c1d344ee66031b.tar.gz |
fw_iso_tx: minor code refactoring to check GError argument
This commit improves check of argument for GError.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r-- | src/fw_iso_tx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fw_iso_tx.c b/src/fw_iso_tx.c index 8d0229a..254ac59 100644 --- a/src/fw_iso_tx.c +++ b/src/fw_iso_tx.c @@ -101,7 +101,7 @@ void hinoko_fw_iso_tx_allocate(HinokoFwIsoTx *self, const char *path, guint header_size, GError **error) { g_return_if_fail(HINOKO_IS_FW_ISO_TX(self)); - g_return_if_fail(error != NULL && *error == NULL); + g_return_if_fail(error == NULL || *error == NULL); hinoko_fw_iso_ctx_allocate(HINOKO_FW_ISO_CTX(self), path, HINOKO_FW_ISO_CTX_MODE_TX, scode, channel, @@ -140,7 +140,7 @@ void hinoko_fw_iso_tx_map_buffer(HinokoFwIsoTx *self, HinokoFwIsoTxPrivate *priv; g_return_if_fail(HINOKO_IS_FW_ISO_TX(self)); - g_return_if_fail(error != NULL && *error == NULL); + g_return_if_fail(error == NULL || *error == NULL); priv = hinoko_fw_iso_tx_get_instance_private(self); hinoko_fw_iso_ctx_map_buffer(HINOKO_FW_ISO_CTX(self), @@ -181,7 +181,7 @@ void hinoko_fw_iso_tx_unmap_buffer(HinokoFwIsoTx *self) void hinoko_fw_iso_tx_start(HinokoFwIsoTx *self, const guint16 *cycle_match, GError **error) { g_return_if_fail(HINOKO_IS_FW_ISO_TX(self)); - g_return_if_fail(error != NULL && *error == NULL); + g_return_if_fail(error == NULL || *error == NULL); hinoko_fw_iso_ctx_start(HINOKO_FW_ISO_CTX(self), cycle_match, 0, 0, error); @@ -240,7 +240,7 @@ void hinoko_fw_iso_tx_register_packet(HinokoFwIsoTx *self, (header == NULL && header_length == 0)); g_return_if_fail((payload != NULL && payload_length > 0) || (payload == NULL && payload_length == 0)); - g_return_if_fail(error != NULL && *error == NULL); + g_return_if_fail(error == NULL || *error == NULL); priv = hinoko_fw_iso_tx_get_instance_private(self); |