From patchwork Thu Aug 1 15:46:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 142845 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 A707245711; Thu, 1 Aug 2024 17:49:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D1B743476; Thu, 1 Aug 2024 17:48:40 +0200 (CEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id AF75E4345B for ; Thu, 1 Aug 2024 17:48:36 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1fc566ac769so50840045ad.1 for ; Thu, 01 Aug 2024 08:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1722527316; x=1723132116; 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=VzBRUet1yk4TAU0JS4cBJ0ri5+mMU9zBFB485sZzSF4=; b=FtAmLR8QQcDH10LBfgLlozjELtvyXKKdc3zfVrgUOI/BhVbHPBeIAgbSSI4XvYhAQo 1l9QGr5WcuN1kAtuzwznfnKuSattHRbjZ8Ar/Me/9Vo5hZKRhOJhAg4VVUL8sq14u3lP 6e0HvYp9tZy1IQoSX8bzad4qFcPPifNC4O4XHIUzUW/ryzXmdYO1OVnhnY/K67mXgQ7b 0SPr1zCDVxe8VzLCevGlMIvfYmdng0LITo5230hr3/A8OKoqYJE7yKcv57vjY+OoSS7A ft9f6h+JOy/C7yyYt4bAtNxd/c5/Mensk9ScyhURZuvu5bBRXRI6YRcJQkU7maI4dYe8 BLTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722527316; x=1723132116; 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=VzBRUet1yk4TAU0JS4cBJ0ri5+mMU9zBFB485sZzSF4=; b=NNs3le2PX8A6gB0F/NYe2mq2XUKsdsEDuRldJlp5SFTPJ0iP6btY7gYKJLbP2cyWSQ e2FG/uFc4e9hZhUqWKe6hHvfPkE/J5IJ51enN2nUiixXbnKA47ewK8xzv8c3CWSr4VnH j/tkqwcNf10ZqzvzEyfqx8XmQLtyOUy4mMwl7mfUS/kDRZPkwbaKhXS83tH0yZiW1OLM BS6CJCFB/0MfUdSoj++hp0v90B+hUKSzVEkIo/tsyUACQQNCaMjHhMf+t0h6y459HcAC LsXYT6xxt7HNUwIOcFFMylsEq97EOrSbM/DTU89cnHwo16RkI2rj2ZCFMsv1+6jOJR0J ROrg== X-Gm-Message-State: AOJu0YzPupxP5ibcilESmYeyPF8TBllMRtB24Iovf9W3jdmzITTm5cf0 3UetIvRNQEZ2USJpTRVC1v93SY9bynK/YyjhUCeR6ZmKsP/kvIE8UPRsDwvG95lwpYzIlVYk0ef j X-Google-Smtp-Source: AGHT+IEZECwQXKFS6vOJNnkXDWW+9dWzJC4psjWF+WRH7xfbed6FSXyvwIGA+V+WbfU8brtBrJnrFw== X-Received: by 2002:a17:903:32c6:b0:1fc:560b:1456 with SMTP id d9443c01a7336-1ff5728f232mr8494415ad.15.1722527315901; Thu, 01 Aug 2024 08:48:35 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ff590579b3sm92405ad.178.2024.08.01.08.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 08:48:35 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v11 5/7] lib: replace use of sanity check in comments and messages Date: Thu, 1 Aug 2024 08:46:38 -0700 Message-ID: <20240801154821.150443-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240801154821.150443-1-stephen@networkplumber.org> References: <20240529233811.663211-1-stephen@networkplumber.org> <20240801154821.150443-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 d5b8c9f918..073d3fe7a2 100644 --- a/lib/graph/graph.c +++ b/lib/graph/graph.c @@ -389,7 +389,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 d71451a17b..10b7fc11be 100644 --- a/lib/graph/graph_stats.c +++ b/lib/graph/graph_stats.c @@ -332,7 +332,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 99a9622779..c238d140ed 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 af565a14ea..1c4b280c95 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 0ccdbabc04..f60d4f3f6e 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 7254defce7..ee065acda6 100644 --- a/lib/pcapng/rte_pcapng.c +++ b/lib/pcapng/rte_pcapng.c @@ -620,7 +620,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))) {