aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2022-05-03 07:57:47 +0900
committer坂本 貴史 <o-takashi@sakamocchi.jp>2022-05-03 08:31:29 +0900
commit1b63c76890769775044287b539ae7338881dbc37 (patch)
tree184859a98d0446459ca29ad5d6621df8bc9b3968
parent7276ab04eed297b99e7957e3eba1c6e8956abe52 (diff)
downloadlibhinoko-1b63c76890769775044287b539ae7338881dbc37.tar.gz
fw_iso_ctx: 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_ctx.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/fw_iso_ctx.c b/src/fw_iso_ctx.c
index bbb12fa..a6f6cfe 100644
--- a/src/fw_iso_ctx.c
+++ b/src/fw_iso_ctx.c
@@ -209,7 +209,7 @@ void hinoko_fw_iso_ctx_allocate(HinokoFwIsoCtx *self, const char *path,
g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
g_return_if_fail(path != NULL && strlen(path) > 0);
- g_return_if_fail(error != NULL && *error == NULL);
+ g_return_if_fail(error == NULL || *error == NULL);
// Linux firewire stack supports three types of isochronous context
// described in 1394 OHCI specification.
@@ -324,7 +324,7 @@ void hinoko_fw_iso_ctx_map_buffer(HinokoFwIsoCtx *self, guint bytes_per_chunk,
g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
g_return_if_fail(bytes_per_chunk > 0);
g_return_if_fail(chunks_per_buffer > 0);
- g_return_if_fail(error != NULL && *error == NULL);
+ g_return_if_fail(error == NULL || *error == NULL);
priv = hinoko_fw_iso_ctx_get_instance_private(self);
if (priv->fd < 0) {
@@ -408,7 +408,7 @@ void hinoko_fw_iso_ctx_get_cycle_timer(HinokoFwIsoCtx *self, gint clock_id,
g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
g_return_if_fail(cycle_timer != NULL);
- g_return_if_fail(error != NULL && *error == NULL);
+ g_return_if_fail(error == NULL || *error == NULL);
priv = hinoko_fw_iso_ctx_get_instance_private(self);
if (priv->fd < 0) {
@@ -437,7 +437,7 @@ void hinoko_fw_iso_ctx_set_rx_channels(HinokoFwIsoCtx *self,
struct fw_cdev_set_iso_channels set = {0};
g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
- g_return_if_fail(error != NULL && *error == NULL);
+ g_return_if_fail(error == NULL || *error == NULL);
priv = hinoko_fw_iso_ctx_get_instance_private(self);
g_return_if_fail(priv->mode == HINOKO_FW_ISO_CTX_MODE_RX_MULTIPLE);
@@ -483,7 +483,7 @@ void hinoko_fw_iso_ctx_register_chunk(HinokoFwIsoCtx *self, gboolean skip,
g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
g_return_if_fail(skip == TRUE || skip == FALSE);
- g_return_if_fail(error != NULL && *error == NULL);
+ g_return_if_fail(error == NULL || *error == NULL);
g_return_if_fail(tags == 0 ||
tags == HINOKO_FW_ISO_CTX_MATCH_FLAG_TAG0 ||
@@ -791,7 +791,7 @@ void hinoko_fw_iso_ctx_create_source(HinokoFwIsoCtx *self, GSource **gsrc,
g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
g_return_if_fail(gsrc != NULL);
- g_return_if_fail(error != NULL && *error == NULL);
+ g_return_if_fail(error == NULL || *error == NULL);
priv = hinoko_fw_iso_ctx_get_instance_private(self);
if (priv->fd < 0) {
@@ -844,7 +844,7 @@ void hinoko_fw_iso_ctx_start(HinokoFwIsoCtx *self, const guint16 *cycle_match, g
gint cycle;
g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
- g_return_if_fail(error != NULL && *error == NULL);
+ g_return_if_fail(error == NULL || *error == NULL);
priv = hinoko_fw_iso_ctx_get_instance_private(self);
if (priv->fd < 0) {