From nobody Wed Feb 12 19:34:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YtT623rXWz5nGGM; Wed, 12 Feb 2025 19:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YtT611zQBz3SxK; Wed, 12 Feb 2025 19:34:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739388873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z5xACSw0DkdRiIxhmGUygFH6v/7BxkGIspHb7E8BhKA=; b=DogKgFxnNaitHWJW+a8OSUYTFIBOj3moYSmNJRtR2eFbS4YugOp9mYIlXEqeyMn3FMW14h I35tMMXaU8+1VmCBD/rMrKhZZErePSUdoFhgHDJTSg2vvgLMbx4MmoadnA9zoz8q/h+7vK UIeY0ciR6Eo4CcTqN70Yt48huAfVZYw13e6f1C6I7gyDk8wtVAf6c154kKqNHBOrxldpx+ T0syiPR448YWVkpTavCTlUb4JbEQgrUIhYf3Nt81FxLP8sucXmY8UJfSMD9IOD3rtZmtU/ 8YSqebHEMQanRqMJXWGKB28K5gce0+MfhKrsXmSziz/dFMnPJweQnkOFfWAx5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739388873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z5xACSw0DkdRiIxhmGUygFH6v/7BxkGIspHb7E8BhKA=; b=je6OAIfX4mS0CXciZ8p3umbVduDBgW9abYKdckRJwYEJMQExG50zW8l6swWgHBt/1eWAmz EJfrr0EW0fcNj0snWY1DTpbC0r8KTseznw3QRlPzp4zHKSD4PNvO5b8cj+v57Z5Bu6tAop d4MLftkTK4weq711WTfpbCrwTjoP4ADeEew2CammrXkW+RKll/8M4YsMFY+Nu+uax5NzjJ Qt99RbgKzKiF3C5aIOg/1MZChyULo6RjO5Xaa7nhwMuFpw9NJzw7Nd8K+a/GnbPtYtFnje 8UquJLI1gmlvxgD+aHuBaIXefPm9Yshis3ooB+T+h3x6eo5v3jiEHt/4JbSR5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739388873; a=rsa-sha256; cv=none; b=eBCPnPsWfOwzIMdHvfFgHPi4iGl1BTE298JAgPgqiilBvfuoFycasZhgQJtQw3cfISvVmO +DDiprlW1VldANUZ/DF820hwvnLQqljDjM0DvrQ4LJzpUz9AFqqWQi5huW8HKxtt9PGMvs AoGvWL71W4ZNiX3MkDNgJeeg3IiVLd0CO4NNw2ftq383MOw3+Xee+bq3O9PJKPUHMECTGq bYxxw16E/G5cYXpu4AqYSmK8ofkVSylWfAYiW4qA/2TxMg4J5b+GJgXmQc+OfQvRTX1tD0 Dw18zzakjrGHEnC/xL2/8eCdryIvKmD6teDbRChPslc4QZcVnKJ1rhsB1F8nSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YtT611Cqgz1BWm; Wed, 12 Feb 2025 19:34:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51CJYXka059871; Wed, 12 Feb 2025 19:34:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51CJYXPN059868; Wed, 12 Feb 2025 19:34:33 GMT (envelope-from git) Date: Wed, 12 Feb 2025 19:34:33 GMT Message-Id: <202502121934.51CJYXPN059868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 79a4240b1359 - main - ctld: Use preferred style for evaluating result of strcmp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79a4240b135952cb318adf216a9e5d3ccbd6e343 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=79a4240b135952cb318adf216a9e5d3ccbd6e343 commit 79a4240b135952cb318adf216a9e5d3ccbd6e343 Author: John Baldwin AuthorDate: 2025-02-12 19:27:30 +0000 Commit: John Baldwin CommitDate: 2025-02-12 19:27:30 +0000 ctld: Use preferred style for evaluating result of strcmp Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48932 --- usr.sbin/ctld/uclparse.c | 86 ++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/usr.sbin/ctld/uclparse.c b/usr.sbin/ctld/uclparse.c index 8654004d009e..b782779f4d0e 100644 --- a/usr.sbin/ctld/uclparse.c +++ b/usr.sbin/ctld/uclparse.c @@ -253,7 +253,7 @@ uclparse_toplevel(const ucl_object_t *top) while ((obj = ucl_iterate_object(top, &it, true))) { const char *key = ucl_object_key(obj); - if (!strcmp(key, "debug")) { + if (strcmp(key, "debug") == 0) { if (obj->type == UCL_INT) conf->conf_debug = ucl_object_toint(obj); else { @@ -262,7 +262,7 @@ uclparse_toplevel(const ucl_object_t *top) } } - if (!strcmp(key, "timeout")) { + if (strcmp(key, "timeout") == 0) { if (obj->type == UCL_INT) conf->conf_timeout = ucl_object_toint(obj); else { @@ -271,7 +271,7 @@ uclparse_toplevel(const ucl_object_t *top) } } - if (!strcmp(key, "maxproc")) { + if (strcmp(key, "maxproc") == 0) { if (obj->type == UCL_INT) conf->conf_maxproc = ucl_object_toint(obj); else { @@ -280,7 +280,7 @@ uclparse_toplevel(const ucl_object_t *top) } } - if (!strcmp(key, "pidfile")) { + if (strcmp(key, "pidfile") == 0) { if (obj->type == UCL_STRING) conf->conf_pidfile_path = strdup( ucl_object_tostring(obj)); @@ -290,7 +290,7 @@ uclparse_toplevel(const ucl_object_t *top) } } - if (!strcmp(key, "isns-server")) { + if (strcmp(key, "isns-server") == 0) { if (obj->type == UCL_ARRAY) { iter = NULL; while ((child = ucl_iterate_object(obj, &iter, @@ -309,7 +309,7 @@ uclparse_toplevel(const ucl_object_t *top) } } - if (!strcmp(key, "isns-period")) { + if (strcmp(key, "isns-period") == 0) { if (obj->type == UCL_INT) conf->conf_isns_period = ucl_object_toint(obj); else { @@ -318,7 +318,7 @@ uclparse_toplevel(const ucl_object_t *top) } } - if (!strcmp(key, "isns-timeout")) { + if (strcmp(key, "isns-timeout") == 0) { if (obj->type == UCL_INT) conf->conf_isns_timeout = ucl_object_toint(obj); else { @@ -327,7 +327,7 @@ uclparse_toplevel(const ucl_object_t *top) } } - if (!strcmp(key, "auth-group")) { + if (strcmp(key, "auth-group") == 0) { if (obj->type == UCL_OBJECT) { iter = NULL; while ((child = ucl_iterate_object(obj, &iter, true))) { @@ -339,7 +339,7 @@ uclparse_toplevel(const ucl_object_t *top) } } - if (!strcmp(key, "portal-group")) { + if (strcmp(key, "portal-group") == 0) { if (obj->type == UCL_OBJECT) { iter = NULL; while ((child = ucl_iterate_object(obj, &iter, true))) { @@ -351,7 +351,7 @@ uclparse_toplevel(const ucl_object_t *top) } } - if (!strcmp(key, "lun")) { + if (strcmp(key, "lun") == 0) { if (obj->type == UCL_OBJECT) { iter = NULL; while ((child = ucl_iterate_object(obj, &iter, true))) { @@ -369,7 +369,7 @@ uclparse_toplevel(const ucl_object_t *top) while ((obj = ucl_iterate_object(top, &it, true))) { const char *key = ucl_object_key(obj); - if (!strcmp(key, "target")) { + if (strcmp(key, "target") == 0) { if (obj->type == UCL_OBJECT) { iter = NULL; while ((child = ucl_iterate_object(obj, &iter, @@ -397,7 +397,7 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) const ucl_object_t *obj = NULL, *tmp = NULL; const char *key; - if (!strcmp(name, "default") && + if (strcmp(name, "default") == 0 && conf->conf_default_ag_defined == false) { auth_group = auth_group_find(conf, name); conf->conf_default_ag_defined = true; @@ -411,14 +411,14 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj); - if (!strcmp(key, "auth-type")) { + if (strcmp(key, "auth-type") == 0) { const char *value = ucl_object_tostring(obj); if (!auth_group_set_type(auth_group, value)) return (false); } - if (!strcmp(key, "chap")) { + if (strcmp(key, "chap") == 0) { if (obj->type != UCL_ARRAY) { log_warnx("\"chap\" property of " "auth-group \"%s\" is not an array", @@ -433,7 +433,7 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) } } - if (!strcmp(key, "chap-mutual")) { + if (strcmp(key, "chap-mutual") == 0) { if (obj->type != UCL_ARRAY) { log_warnx("\"chap-mutual\" property of " "auth-group \"%s\" is not an array", @@ -448,7 +448,7 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) } } - if (!strcmp(key, "initiator-name")) { + if (strcmp(key, "initiator-name") == 0) { if (obj->type != UCL_ARRAY) { log_warnx("\"initiator-name\" property of " "auth-group \"%s\" is not an array", @@ -466,7 +466,7 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) } } - if (!strcmp(key, "initiator-portal")) { + if (strcmp(key, "initiator-portal") == 0) { if (obj->type != UCL_ARRAY) { log_warnx("\"initiator-portal\" property of " "auth-group \"%s\" is not an array", @@ -597,7 +597,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj); - if (!strcmp(key, "discovery-auth-group")) { + if (strcmp(key, "discovery-auth-group") == 0) { portal_group->pg_discovery_auth_group = auth_group_find(conf, ucl_object_tostring(obj)); if (portal_group->pg_discovery_auth_group == NULL) { @@ -609,7 +609,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) } } - if (!strcmp(key, "discovery-filter")) { + if (strcmp(key, "discovery-filter") == 0) { if (obj->type != UCL_STRING) { log_warnx("\"discovery-filter\" property of " "portal-group \"%s\" is not a string", @@ -622,7 +622,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) return (false); } - if (!strcmp(key, "listen")) { + if (strcmp(key, "listen") == 0) { if (obj->type == UCL_STRING) { if (!portal_group_add_listen(portal_group, ucl_object_tostring(obj), false)) @@ -644,7 +644,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) } } - if (!strcmp(key, "listen-iser")) { + if (strcmp(key, "listen-iser") == 0) { if (obj->type == UCL_STRING) { if (!portal_group_add_listen(portal_group, ucl_object_tostring(obj), true)) @@ -666,7 +666,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) } } - if (!strcmp(key, "redirect")) { + if (strcmp(key, "redirect") == 0) { if (obj->type != UCL_STRING) { log_warnx("\"listen\" property of " "portal-group \"%s\" is not a string", @@ -679,7 +679,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) return (false); } - if (!strcmp(key, "options")) { + if (strcmp(key, "options") == 0) { if (obj->type != UCL_OBJECT) { log_warnx("\"options\" property of portal group " "\"%s\" is not an object", portal_group->pg_name); @@ -695,12 +695,12 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) } } - if (!strcmp(key, "dscp")) { + if (strcmp(key, "dscp") == 0) { if (!uclparse_dscp("portal", portal_group, obj)) return (false); } - if (!strcmp(key, "pcp")) { + if (strcmp(key, "pcp") == 0) { if (!uclparse_pcp("portal", portal_group, obj)) return (false); } @@ -724,7 +724,7 @@ uclparse_target(const char *name, const ucl_object_t *top) while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj); - if (!strcmp(key, "alias")) { + if (strcmp(key, "alias") == 0) { if (obj->type != UCL_STRING) { log_warnx("\"alias\" property of target " "\"%s\" is not a string", target->t_name); @@ -734,7 +734,7 @@ uclparse_target(const char *name, const ucl_object_t *top) target->t_alias = strdup(ucl_object_tostring(obj)); } - if (!strcmp(key, "auth-group")) { + if (strcmp(key, "auth-group") == 0) { const char *ag; if (target->t_auth_group != NULL) { @@ -762,7 +762,7 @@ uclparse_target(const char *name, const ucl_object_t *top) } } - if (!strcmp(key, "auth-type")) { + if (strcmp(key, "auth-type") == 0) { if (target->t_auth_group != NULL) { if (target->t_auth_group->ag_name != NULL) { log_warnx("cannot use both auth-group and " @@ -782,7 +782,7 @@ uclparse_target(const char *name, const ucl_object_t *top) return (false); } - if (!strcmp(key, "chap")) { + if (strcmp(key, "chap") == 0) { if (target->t_auth_group != NULL) { if (target->t_auth_group->ag_name != NULL) { log_warnx("cannot use both auth-group " @@ -801,12 +801,12 @@ uclparse_target(const char *name, const ucl_object_t *top) return (false); } - if (!strcmp(key, "chap-mutual")) { + if (strcmp(key, "chap-mutual") == 0) { if (!uclparse_chap_mutual(target->t_auth_group, obj)) return (false); } - if (!strcmp(key, "initiator-name")) { + if (strcmp(key, "initiator-name") == 0) { const struct auth_name *an; if (target->t_auth_group != NULL) { @@ -829,7 +829,7 @@ uclparse_target(const char *name, const ucl_object_t *top) return (false); } - if (!strcmp(key, "initiator-portal")) { + if (strcmp(key, "initiator-portal") == 0) { const struct auth_portal *ap; if (target->t_auth_group != NULL) { @@ -852,7 +852,7 @@ uclparse_target(const char *name, const ucl_object_t *top) return (false); } - if (!strcmp(key, "portal-group")) { + if (strcmp(key, "portal-group") == 0) { if (obj->type == UCL_OBJECT) { if (!uclparse_target_portal_group(target, obj)) return (false); @@ -868,14 +868,14 @@ uclparse_target(const char *name, const ucl_object_t *top) } } - if (!strcmp(key, "port")) { + if (strcmp(key, "port") == 0) { const char *value; value = ucl_object_tostring(obj); target->t_pport = strdup(value); } - if (!strcmp(key, "redirect")) { + if (strcmp(key, "redirect") == 0) { if (obj->type != UCL_STRING) { log_warnx("\"redirect\" property of target " "\"%s\" is not a string", target->t_name); @@ -887,7 +887,7 @@ uclparse_target(const char *name, const ucl_object_t *top) return (false); } - if (!strcmp(key, "lun")) { + if (strcmp(key, "lun") == 0) { while ((tmp = ucl_iterate_object(obj, &it2, true))) { if (!uclparse_target_lun(target, tmp)) return (false); @@ -913,7 +913,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj); - if (!strcmp(key, "backend")) { + if (strcmp(key, "backend") == 0) { if (obj->type != UCL_STRING) { log_warnx("\"backend\" property of lun " "\"%s\" is not a string", @@ -924,7 +924,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) lun_set_backend(lun, ucl_object_tostring(obj)); } - if (!strcmp(key, "blocksize")) { + if (strcmp(key, "blocksize") == 0) { if (obj->type != UCL_INT) { log_warnx("\"blocksize\" property of lun " "\"%s\" is not an integer", lun->l_name); @@ -934,7 +934,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) lun_set_blocksize(lun, ucl_object_toint(obj)); } - if (!strcmp(key, "device-id")) { + if (strcmp(key, "device-id") == 0) { if (obj->type != UCL_STRING) { log_warnx("\"device-id\" property of lun " "\"%s\" is not an integer", lun->l_name); @@ -944,7 +944,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) lun_set_device_id(lun, ucl_object_tostring(obj)); } - if (!strcmp(key, "options")) { + if (strcmp(key, "options") == 0) { if (obj->type != UCL_OBJECT) { log_warnx("\"options\" property of lun " "\"%s\" is not an object", lun->l_name); @@ -960,7 +960,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) } } - if (!strcmp(key, "path")) { + if (strcmp(key, "path") == 0) { if (obj->type != UCL_STRING) { log_warnx("\"path\" property of lun " "\"%s\" is not a string", lun->l_name); @@ -970,7 +970,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) lun_set_path(lun, ucl_object_tostring(obj)); } - if (!strcmp(key, "serial")) { + if (strcmp(key, "serial") == 0) { if (obj->type != UCL_STRING) { log_warnx("\"serial\" property of lun " "\"%s\" is not a string", lun->l_name); @@ -980,7 +980,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) lun_set_serial(lun, ucl_object_tostring(obj)); } - if (!strcmp(key, "size")) { + if (strcmp(key, "size") == 0) { if (obj->type != UCL_INT) { log_warnx("\"size\" property of lun " "\"%s\" is not an integer", lun->l_name);