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 variable error
Date: Wed, 5 Jan 2022 22:30:13 +0000 [thread overview]
Message-ID: <20220105223013.162599-1-slyich@gmail.com> (raw)
Without the change the build fails as:
devmapper.c:58:69: error: unused parameter 'udev_flags' [-Werror=unused-parameter]
58 | int dm_simplecmd(int task, const char *name, int no_flush, uint16_t udev_flags)
| ~~~~~~~~~^~~~~~~~~~
The change adds __attribute__((used)) annotation to unused function parameter.
CC: Martin Wilck <mwilck@suse.com>
CC: Benjamin Marzinski <bmarzins@redhat.com>
---
kpartx/devmapper.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c
index 511c090f..49ffd310 100644
--- a/kpartx/devmapper.c
+++ b/kpartx/devmapper.c
@@ -18,6 +18,12 @@
#define MAX_PREFIX_LEN (_UUID_PREFIX_LEN + 4)
#define PARAMS_SIZE 1024
+#ifdef LIBDM_API_COOKIE
+# define __DM_API_COOKIE_UNUSED__ /* empty */
+#else
+# define __DM_API_COOKIE_UNUSED__ __attribute__((unused))
+#endif
+
int dm_prereq(char * str, uint32_t x, uint32_t y, uint32_t z)
{
int r = 1;
@@ -55,7 +61,7 @@ out:
return r;
}
-int dm_simplecmd(int task, const char *name, int no_flush, uint16_t udev_flags)
+int dm_simplecmd(int task, const char *name, int no_flush, __DM_API_COOKIE_UNUSED__ uint16_t udev_flags)
{
int r = 0;
#ifdef LIBDM_API_COOKIE
--
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: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220105223013.162599-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.