All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyich@gmail.com>
To: dm-devel@redhat.com
Cc: Sergei Trofimovich <slyich@gmail.com>, Martin Wilck <mwilck@suse.com>
Subject: [dm-devel] [PATCH] kpartx/devmapper.c: fix unused-but-set variable error
Date: Wed,  5 Jan 2022 22:30:06 +0000	[thread overview]
Message-ID: <20220105223006.162573-1-slyich@gmail.com> (raw)

On gcc-12 build failed as:

    devmapper.c: In function 'dm_simplecmd':
    devmapper.c:61:13: error: unused variable 'udev_wait_flag' [-Werror=unused-variable]
       61 |         int udev_wait_flag = (task == DM_DEVICE_RESUME ||
          |             ^~~~~~~~~~~~~~

Fix error by hiding it's declaration under #ifdef that uses it.
CC: Martin Wilck <mwilck@suse.com>
CC: Benjamin Marzinski <bmarzins@redhat.com>
---
 kpartx/devmapper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c
index 3efd6dfc..511c090f 100644
--- a/kpartx/devmapper.c
+++ b/kpartx/devmapper.c
@@ -58,9 +58,9 @@ out:
 int dm_simplecmd(int task, const char *name, int no_flush, uint16_t udev_flags)
 {
 	int r = 0;
+#ifdef LIBDM_API_COOKIE
 	int udev_wait_flag = (task == DM_DEVICE_RESUME ||
 			      task == DM_DEVICE_REMOVE);
-#ifdef LIBDM_API_COOKIE
 	uint32_t cookie = 0;
 #endif
 	struct dm_task *dmt;
-- 
2.34.1

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


             reply	other threads:[~2022-01-05 22:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 22:30 Sergei Trofimovich [this message]
2022-01-06 10:55 ` [dm-devel] [PATCH] kpartx/devmapper.c: fix unused-but-set variable error Martin Wilck
2022-01-06 10:58   ` Martin Wilck
2022-01-09  9:28     ` [dm-devel] [PATCH v2 1/2] " Sergei Trofimovich
2022-01-09  9:28       ` [dm-devel] [PATCH v2 2/2] kpartx/devmapper.c: fix unused " Sergei Trofimovich
2022-01-10 16:57       ` [dm-devel] [PATCH v2 1/2] kpartx/devmapper.c: fix unused-but-set " Martin Wilck
2022-01-06 11:00 ` [dm-devel] [PATCH] " Martin Wilck

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=20220105223006.162573-1-slyich@gmail.com \
    --to=slyich@gmail.com \
    --cc=dm-devel@redhat.com \
    --cc=mwilck@suse.com \
    /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.