From: Uwe Hermann Date: Wed, 17 Apr 2019 15:09:17 +0000 (+0200) Subject: sr_session_send_meta(): Drop unneeded check. X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=965261008009e41e9f89efe416ed1ae5d23aadaf;hp=26e96658ab62f38c5a3c50341f7b36f548e741b0 sr_session_send_meta(): Drop unneeded check. As of right now, sr_config_new() "cannot fail" and will never return NULL. --- diff --git a/src/hwdriver.c b/src/hwdriver.c index a2d53167..88e3532a 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -571,6 +571,12 @@ SR_PRIV void sr_hw_cleanup_all(const struct sr_context *ctx) * * A floating reference can be passed in for data. * + * @param key The config key to use. + * @param data The GVariant data to use. + * + * @return The newly allocated struct sr_config. This function is assumed + * to never fail. + * * @private */ SR_PRIV struct sr_config *sr_config_new(uint32_t key, GVariant *data) diff --git a/src/session.c b/src/session.c index bfc0a35a..0940617c 100644 --- a/src/session.c +++ b/src/session.c @@ -1092,8 +1092,6 @@ SR_PRIV int sr_session_send_meta(const struct sr_dev_inst *sdi, int ret; cfg = sr_config_new(key, var); - if (!cfg) - return SR_ERR; memset(&meta, 0, sizeof(meta));