public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: baomingtong001@208suo.com
To: agk@redhat.com, snitzer@kernel.org, dm-devel@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] dm log: remove unneeded variable
Date: Wed, 14 Jun 2023 15:58:52 +0800	[thread overview]
Message-ID: <d63fefa76e501dc05353a7d682d83541@208suo.com> (raw)
In-Reply-To: <20230614075528.11930-1-luojianhong@cdjrlc.com>

fix the following coccicheck warning:

drivers/md/dm-snap-transient.c:94:14-16: Unneeded variable: "sz". Return 
"0".
drivers/md/dm-ps-historical-service-time.c:240:14-16: Unneeded variable: 
"sz". Return "0".

Signed-off-by: Mingtong Bao <baomingtong001@208suo.com>
---
  drivers/md/dm-log.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index f9f84236dfcd..38bcdd5ddb21 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -793,7 +793,6 @@ static region_t core_get_sync_count(struct 
dm_dirty_log *log)
  static int core_status(struct dm_dirty_log *log, status_type_t status,
                 char *result, unsigned int maxlen)
  {
-    int sz = 0;
      struct log_c *lc = log->context;

      switch (status) {
@@ -812,13 +811,12 @@ static int core_status(struct dm_dirty_log *log, 
status_type_t status,
          break;
      }

-    return sz;
+    return 0;
  }

  static int disk_status(struct dm_dirty_log *log, status_type_t status,
                 char *result, unsigned int maxlen)
  {
-    int sz = 0;
      struct log_c *lc = log->context;

      switch (status) {
@@ -841,7 +839,7 @@ static int disk_status(struct dm_dirty_log *log, 
status_type_t status,
          break;
      }

-    return sz;
+    return 0;
  }

  static struct dm_dirty_log_type _core_type = {

           reply	other threads:[~2023-06-14  7:59 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20230614075528.11930-1-luojianhong@cdjrlc.com>]

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=d63fefa76e501dc05353a7d682d83541@208suo.com \
    --to=baomingtong001@208suo.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox