All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Sakai <msakai@redhat.com>
To: dm-devel@lists.linux.dev
Cc: Mike Snitzer <snitzer@kernel.org>, Matthew Sakai <msakai@redhat.com>
Subject: [PATCH 10/10] dm vdo target: eliminate inappropriate uses of UDS_SUCCESS
Date: Thu, 29 Feb 2024 23:38:53 -0500	[thread overview]
Message-ID: <0c9af9a15a122f7e2035a0dd7693b7f593dfa693.1709267598.git.msakai@redhat.com> (raw)
In-Reply-To: <cover.1709267597.git.msakai@redhat.com>

From: Mike Snitzer <snitzer@kernel.org>

Most should be VDO_SUCCESS.  But comparing the return from
kstrtouint() with UDS_SUCCESS (happens to be 0) makes no sense.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
---
 drivers/md/dm-vdo/dm-vdo-target.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/md/dm-vdo/dm-vdo-target.c b/drivers/md/dm-vdo/dm-vdo-target.c
index e493b2fec90b..5f607dbb16e9 100644
--- a/drivers/md/dm-vdo/dm-vdo-target.c
+++ b/drivers/md/dm-vdo/dm-vdo-target.c
@@ -318,7 +318,7 @@ static int split_string(const char *string, char separator, char ***substring_ar
 	current_substring++;
 	/* substrings[current_substring] is NULL already */
 	*substring_array_ptr = substrings;
-	return UDS_SUCCESS;
+	return VDO_SUCCESS;
 }
 
 /*
@@ -356,7 +356,7 @@ static int join_strings(char **substring_array, size_t array_length, char separa
 		*(current_position - 1) = '\0';
 
 	*string_ptr = output;
-	return UDS_SUCCESS;
+	return VDO_SUCCESS;
 }
 
 /**
@@ -484,7 +484,7 @@ static int parse_one_thread_config_spec(const char *spec,
 	int result;
 
 	result = split_string(spec, '=', &fields);
-	if (result != UDS_SUCCESS)
+	if (result != VDO_SUCCESS)
 		return result;
 
 	if ((fields[0] == NULL) || (fields[1] == NULL) || (fields[2] != NULL)) {
@@ -495,7 +495,7 @@ static int parse_one_thread_config_spec(const char *spec,
 	}
 
 	result = kstrtouint(fields[1], 10, &count);
-	if (result != UDS_SUCCESS) {
+	if (result) {
 		uds_log_error("thread config string error: integer value needed, found \"%s\"",
 			      fields[1]);
 		free_string_array(fields);
@@ -537,7 +537,7 @@ static int parse_thread_config_string(const char *string,
 		unsigned int i;
 
 		result = split_string(string, ',', &specs);
-		if (result != UDS_SUCCESS)
+		if (result != VDO_SUCCESS)
 			return result;
 
 		for (i = 0; specs[i] != NULL; i++) {
@@ -607,7 +607,7 @@ static int parse_one_key_value_pair(const char *key, const char *value,
 
 	/* The remaining arguments must have integral values. */
 	result = kstrtouint(value, 10, &count);
-	if (result != UDS_SUCCESS) {
+	if (result) {
 		uds_log_error("optional config string error: integer value needed, found \"%s\"",
 			      value);
 		return result;
@@ -2913,7 +2913,7 @@ static int __init vdo_init(void)
 
 	/* Add VDO errors to the set of errors registered by the indexer. */
 	result = vdo_register_status_codes();
-	if (result != UDS_SUCCESS) {
+	if (result != VDO_SUCCESS) {
 		uds_log_error("vdo_register_status_codes failed %d", result);
 		vdo_module_destroy();
 		return result;
-- 
2.42.0


      parent reply	other threads:[~2024-03-01  4:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01  4:38 [PATCH 00/10] dm vdo: standardize on VDO_SUCCESS Matthew Sakai
2024-03-01  4:38 ` [PATCH 01/10] dm vdo errors: remove unused error codes Matthew Sakai
2024-03-01  4:38 ` [PATCH 02/10] dm vdo memory-alloc: return VDO_SUCCESS on success Matthew Sakai
2024-03-01  4:38 ` [PATCH 03/10] dm vdo: check for VDO_SUCCESS return value from memory-alloc functions Matthew Sakai
2024-03-01  4:38 ` [PATCH 04/10] dm vdo int-map: return VDO_SUCCESS on success Matthew Sakai
2024-03-01  4:38 ` [PATCH 05/10] dm vdo thread-utils: return VDO_SUCCESS on vdo_create_thread success Matthew Sakai
2024-03-01  4:38 ` [PATCH 06/10] dm-vdo funnel-workqueue: return VDO_SUCCESS from make_simple_work_queue Matthew Sakai
2024-03-01  4:38 ` [PATCH 07/10] dm vdo permassert: audit all of ASSERT to test for VDO_SUCCESS Matthew Sakai
2024-03-01  4:38 ` [PATCH 08/10] dm vdo encodings: update some stale comments Matthew Sakai
2024-03-01  4:38 ` [PATCH 09/10] dm vdo indexer: update ASSERT and ASSERT_LOG_ONLY usage Matthew Sakai
2024-03-01  4:38 ` Matthew Sakai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0c9af9a15a122f7e2035a0dd7693b7f593dfa693.1709267598.git.msakai@redhat.com \
    --to=msakai@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=snitzer@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.