From patchwork Mon Feb 5 17:43:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 136396 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 01EA543A73; Mon, 5 Feb 2024 19:04:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 84ED6410F1; Mon, 5 Feb 2024 19:03:51 +0100 (CET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 106CF40EDF for ; Mon, 5 Feb 2024 19:03:48 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1d73066880eso40762425ad.3 for ; Mon, 05 Feb 2024 10:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1707156227; x=1707761027; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z0sSlJYi03kscoZ3gDSMZlPaDhE+Va5+wqjhjq17duk=; b=TLenU0GxyDOEi2dHx2iOPnOYjV5hxpPqsJKMFxpUKCBtM4RCp1m1I+qstfU48wqXFr zWKC+ZCRdF3pSW70pfq/Cw8+GLFh5KoTY8dMmpcTDNTCJ4SKUrSQE0EiDE/hnzuL5lRN mwATZWPZS622vCiHHE4RGyM3kngy4NAodFidYrkxAKoWfgjrdBUjlAOFkhbnVdVaWEsm xqzuix8KN4i4Ws0Pnso+eXnPjA13dKGSlx/YDg0RynsaECsB+zUBFCOu5Sfg1CDKYnjx 5tnbD4zGxnLiY5/+4imt9SpOClq+j6N0XLFu7XJHxLen3FlLgYKq0nCENkgnC1xL/xf6 rr8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707156227; x=1707761027; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z0sSlJYi03kscoZ3gDSMZlPaDhE+Va5+wqjhjq17duk=; b=loGTfJ8MT8ZM6Syg0tKJqnuFOlGJs6ieqO+M7TeneWc9vQRaemVerkNCxw2zBmS+ft A25fchJif8zIq/8rM7mSIBRdv5A1CgPwlhc5C3a0N/G9szOTMizgZNqTIpYAQk1+NOPh csehuiHx2YJ2HhbpbhOR4W+inX4G9uL6M7SEGodxU4XXK4gmgX52FD6BeHObYidzaO6l qa8w8AfnbiNl/a/fNiXxbDZpUAmG29nz+ZHDNYVYHvDIBVHIHv2NZROVSBwfjFjKvwtY 0o6eQ0pDok5TMyjM2Zl84FyhWgXiCFtFtuLvkMYl0UhDaax97OIyjwN6qJkQenpGA8sr V4nQ== X-Gm-Message-State: AOJu0YxxEjSb91EAzOtfeBXVGqoQGhyQ35L6oM0RQmOkOz8SR+0LoOvS os4QsptZwOOp+SyfL0O1A4vE1MVgm6XExmjSpc+NFhUC/kW1cZY+7wNNNHN9dpav8tu4Ce0Mh7H I6NI= X-Google-Smtp-Source: AGHT+IHNxJgYL1UFir7ZLGgEZM45z6Vfb31auJeLWKrUSo2mUBUYkQAtwFjlyqgoZLd8yVr15w5mRQ== X-Received: by 2002:a17:902:e549:b0:1d8:f016:cfaf with SMTP id n9-20020a170902e54900b001d8f016cfafmr225788plf.47.1707156227248; Mon, 05 Feb 2024 10:03:47 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVUVpx6U1sXCpr180x1+LilNRiJLSYXd0Q4NJtUTaT6d0Lvs9nyPDYAtnkpWsYC3yab4tG0lAI2nlomZfaRSd7Yp3vWkBBBQZpEsuPSZzidynCtBqTVZXj1NrczpiC1miN8xOV3GmJOwDrm1/xqG5R9xXQshBfJASbM9gqvXca0vcvwV/9q9z/mgEhzE4fI8EI3pnmVm9f9HrQfHo/ZCillsfIP Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id x8-20020a170902b40800b001d9b0a15bbfsm144867plr.262.2024.02.05.10.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 10:03:46 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram , Zhirun Yan , Reshma Pattan Subject: [PATCH v9 09/23] lib: replace use of sanity check in comments and messages Date: Mon, 5 Feb 2024 09:43:37 -0800 Message-ID: <20240205180328.131019-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205180328.131019-1-stephen@networkplumber.org> References: <0230331200824.195294-1-stephen@networkplumber.org> <20240205180328.131019-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sanity check is on the Tier 2 non-inclusive list. Replace or remove it. Signed-off-by: Stephen Hemminger --- lib/graph/graph.c | 2 +- lib/graph/graph_stats.c | 2 +- lib/graph/node.c | 2 +- lib/jobstats/rte_jobstats.c | 6 +++--- lib/metrics/rte_metrics.c | 2 +- lib/pcapng/rte_pcapng.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/graph/graph.c b/lib/graph/graph.c index 26f0968a978d..e51dcc30568e 100644 --- a/lib/graph/graph.c +++ b/lib/graph/graph.c @@ -344,7 +344,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm) graph_spinlock_lock(); - /* Check arguments sanity */ + /* Check argument validity */ if (prm == NULL) SET_ERR_JMP(EINVAL, fail, "Param should not be NULL"); diff --git a/lib/graph/graph_stats.c b/lib/graph/graph_stats.c index cc32245c0593..cfb30ae07497 100644 --- a/lib/graph/graph_stats.c +++ b/lib/graph/graph_stats.c @@ -317,7 +317,7 @@ rte_graph_cluster_stats_create(const struct rte_graph_cluster_stats_param *prm) const char *pattern; rte_graph_t i; - /* Sanity checks */ + /* Validate arguments */ if (!rte_graph_has_stats_feature()) SET_ERR_JMP(EINVAL, fail, "Stats feature is not enabled"); diff --git a/lib/graph/node.c b/lib/graph/node.c index 99a962277964..c238d140ed31 100644 --- a/lib/graph/node.c +++ b/lib/graph/node.c @@ -68,7 +68,7 @@ __rte_node_register(const struct rte_node_register *reg) graph_spinlock_lock(); - /* Check sanity */ + /* Check argument validity */ if (reg == NULL || reg->process == NULL) { rte_errno = EINVAL; goto fail; diff --git a/lib/jobstats/rte_jobstats.c b/lib/jobstats/rte_jobstats.c index af565a14eaf3..1c4b280c952a 100644 --- a/lib/jobstats/rte_jobstats.c +++ b/lib/jobstats/rte_jobstats.c @@ -124,7 +124,7 @@ rte_jobstats_start(struct rte_jobstats_context *ctx, struct rte_jobstats *job) { uint64_t now; - /* Some sanity check. */ + /* Check validity of arguments. */ if (unlikely(ctx == NULL || job == NULL || job->context != NULL)) return -EINVAL; @@ -144,7 +144,7 @@ rte_jobstats_abort(struct rte_jobstats *job) struct rte_jobstats_context *ctx; uint64_t now, exec_time; - /* Some sanity check. */ + /* Check that arguments are valid */ if (unlikely(job == NULL || job->context == NULL)) return -EINVAL; @@ -165,7 +165,7 @@ rte_jobstats_finish(struct rte_jobstats *job, int64_t job_value) uint64_t now, exec_time; int need_update; - /* Some sanity check. */ + /* Check arguments */ if (unlikely(job == NULL || job->context == NULL)) return -EINVAL; diff --git a/lib/metrics/rte_metrics.c b/lib/metrics/rte_metrics.c index 0ccdbabc04eb..f60d4f3f6e25 100644 --- a/lib/metrics/rte_metrics.c +++ b/lib/metrics/rte_metrics.c @@ -120,7 +120,7 @@ rte_metrics_reg_names(const char * const *names, uint16_t cnt_names) uint16_t idx_name; uint16_t idx_base; - /* Some sanity checks */ + /* Some consistency checks */ if (cnt_names < 1 || names == NULL) return -EINVAL; for (idx_name = 0; idx_name < cnt_names; idx_name++) diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c index f74ec939a9f8..0de0a231693e 100644 --- a/lib/pcapng/rte_pcapng.c +++ b/lib/pcapng/rte_pcapng.c @@ -619,7 +619,7 @@ rte_pcapng_write_packets(rte_pcapng_t *self, struct pcapng_enhance_packet_block *epb; uint64_t cycles, timestamp; - /* sanity check that is really a pcapng mbuf */ + /* Check that is really a pcapng mbuf */ epb = rte_pktmbuf_mtod(m, struct pcapng_enhance_packet_block *); if (unlikely(epb->block_type != PCAPNG_ENHANCED_PACKET_BLOCK || epb->block_length != rte_pktmbuf_data_len(m))) {