From: mwilck@suse.com
To: Christophe Varoqui <christophe.varoqui@opensvc.com>,
Benjamin Marzinski <bmarzins@redhat.com>
Cc: dm-devel@redhat.com, Martin Wilck <mwilck@suse.com>
Subject: [PATCH 13/35] libmultipath: constify blacklist code
Date: Thu, 9 Jul 2020 12:15:58 +0200 [thread overview]
Message-ID: <20200709101620.6786-14-mwilck@suse.com> (raw)
In-Reply-To: <20200709101620.6786-1-mwilck@suse.com>
From: Martin Wilck <mwilck@suse.com>
Add "const" qualifiers where appropriate.
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
libmultipath/blacklist.c | 34 +++++++++++++++++++---------------
libmultipath/blacklist.h | 17 +++++++++++------
2 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c
index db58ccc..4964e70 100644
--- a/libmultipath/blacklist.c
+++ b/libmultipath/blacklist.c
@@ -121,7 +121,7 @@ int set_ble_device(vector blist, char * vendor, char * product, int origin)
}
static int
-match_reglist (vector blist, const char * str)
+match_reglist (const struct _vector *blist, const char *str)
{
int i;
struct blentry * ble;
@@ -134,8 +134,8 @@ match_reglist (vector blist, const char * str)
}
static int
-match_reglist_device (const struct _vector *blist, const char * vendor,
- const char * product)
+match_reglist_device (const struct _vector *blist, const char *vendor,
+ const char * product)
{
int i;
struct blentry_device * ble;
@@ -155,8 +155,8 @@ match_reglist_device (const struct _vector *blist, const char * vendor,
}
static int
-find_blacklist_device (const struct _vector *blist, const char * vendor,
- const char * product)
+find_blacklist_device (const struct _vector *blist, const char *vendor,
+ const char *product)
{
int i;
struct blentry_device * ble;
@@ -231,8 +231,9 @@ setup_default_blist (struct config * conf)
condlog(lvl, "%s: %s %s", dev, (M), (S))
static void
-log_filter (const char *dev, char *vendor, char *product, char *wwid,
- const char *env, const char *protocol, int r, int lvl)
+log_filter (const char *dev, const char *vendor, const char *product,
+ const char *wwid, const char *env, const char *protocol,
+ int r, int lvl)
{
/*
* Try to sort from most likely to least.
@@ -277,8 +278,8 @@ log_filter (const char *dev, char *vendor, char *product, char *wwid,
}
int
-filter_device (vector blist, vector elist, char * vendor, char * product,
- char * dev)
+filter_device (const struct _vector *blist, const struct _vector *elist,
+ const char *vendor, const char * product, const char *dev)
{
int r = MATCH_NOTHING;
@@ -294,7 +295,8 @@ filter_device (vector blist, vector elist, char * vendor, char * product,
}
int
-filter_devnode (vector blist, vector elist, char * dev)
+filter_devnode (const struct _vector *blist, const struct _vector *elist,
+ const char *dev)
{
int r = MATCH_NOTHING;
@@ -310,7 +312,8 @@ filter_devnode (vector blist, vector elist, char * dev)
}
int
-filter_wwid (vector blist, vector elist, char * wwid, char * dev)
+filter_wwid (const struct _vector *blist, const struct _vector *elist,
+ const char *wwid, const char *dev)
{
int r = MATCH_NOTHING;
@@ -326,7 +329,8 @@ filter_wwid (vector blist, vector elist, char * wwid, char * dev)
}
int
-filter_protocol(vector blist, vector elist, struct path * pp)
+filter_protocol(const struct _vector *blist, const struct _vector *elist,
+ const struct path *pp)
{
char buf[PROTOCOL_BUF_SIZE];
int r = MATCH_NOTHING;
@@ -345,7 +349,7 @@ filter_protocol(vector blist, vector elist, struct path * pp)
}
int
-filter_path (struct config * conf, struct path * pp)
+filter_path (const struct config *conf, const struct path *pp)
{
int r;
@@ -367,8 +371,8 @@ filter_path (struct config * conf, struct path * pp)
}
int
-filter_property(struct config *conf, struct udev_device *udev, int lvl,
- const char *uid_attribute)
+filter_property(const struct config *conf, struct udev_device *udev,
+ int lvl, const char *uid_attribute)
{
const char *devname = udev_device_get_sysname(udev);
struct udev_list_entry *list_entry;
diff --git a/libmultipath/blacklist.h b/libmultipath/blacklist.h
index 4305857..ed079f3 100644
--- a/libmultipath/blacklist.h
+++ b/libmultipath/blacklist.h
@@ -36,12 +36,17 @@ struct blentry_device {
int setup_default_blist (struct config *);
int alloc_ble_device (vector);
-int filter_devnode (vector, vector, char *);
-int filter_wwid (vector, vector, char *, char *);
-int filter_device (vector, vector, char *, char *, char *);
-int filter_path (struct config *, struct path *);
-int filter_property(struct config *, struct udev_device *, int, const char*);
-int filter_protocol(vector, vector, struct path *);
+int filter_devnode (const struct _vector *, const struct _vector *,
+ const char *);
+int filter_wwid (const struct _vector *, const struct _vector *,
+ const char *, const char *);
+int filter_device (const struct _vector *, const struct _vector *,
+ const char *, const char *, const char *);
+int filter_path (const struct config *, const struct path *);
+int filter_property(const struct config *, struct udev_device *,
+ int, const char*);
+int filter_protocol(const struct _vector *, const struct _vector *,
+ const struct path *);
int store_ble (vector, char *, int);
int set_ble_device (vector, char *, char *, int);
void free_blacklist (vector);
--
2.26.2
next prev parent reply other threads:[~2020-07-09 10:15 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-09 10:15 [PATCH 00/35] multipath-tools series part I: minor changes mwilck
2020-07-09 10:15 ` [PATCH 01/35] multipath-tools tests/util: separate group for bitmask tests mwilck
2020-07-09 10:15 ` [PATCH 02/35] multipath-tools tests/directio: fix missing initializers mwilck
2020-07-09 10:15 ` [PATCH 03/35] tests: __wrap_dlog: use check_expected() mwilck
2020-07-09 10:15 ` [PATCH 04/35] multipath tools tests: add strchop() test mwilck
2020-07-09 10:15 ` [PATCH 05/35] libmultipath: improve strchop() mwilck
2020-07-09 10:15 ` [PATCH 06/35] multipath-tools tests: add test for devt2devname mwilck
2020-07-09 10:15 ` [PATCH 07/35] libmultipath: devt2devname(): simplify using libudev mwilck
2020-07-09 10:15 ` [PATCH 08/35] libmultipath: create bitfield abstraction mwilck
2020-07-16 21:17 ` Benjamin Marzinski
2020-08-04 15:04 ` Martin Wilck
2020-08-04 15:18 ` Martin Wilck
2020-08-04 16:26 ` Benjamin Marzinski
2020-08-04 19:35 ` Martin Wilck
2020-08-10 18:05 ` Benjamin Marzinski
2020-08-10 18:59 ` Martin Wilck
2020-07-09 10:15 ` [PATCH 09/35] libmultipath: use bitfields in group_by_match() mwilck
2020-07-09 10:15 ` [PATCH 10/35] libmultipath: util: constify function arguments mwilck
2020-07-09 10:15 ` [PATCH 11/35] multipath-tools tests: add unit tests for strlcat mwilck
2020-07-09 10:15 ` [PATCH 12/35] libmultipath: strlcpy()/strlcat(): use restrict qualifier mwilck
2020-07-16 22:18 ` Benjamin Marzinski
2020-08-04 15:36 ` Martin Wilck
2020-08-04 17:29 ` Benjamin Marzinski
2020-08-04 20:15 ` Martin Wilck
2020-07-09 10:15 ` mwilck [this message]
2020-07-09 10:15 ` [PATCH 14/35] libmultipath: rlookup_binding(): remove newline in log message mwilck
2020-07-09 10:16 ` [PATCH 15/35] libmultipath: fix missing initializer warning from clang 3.9 mwilck
2020-07-09 10:16 ` [PATCH 16/35] libmultipath: fix gcc -Wstringop-overflow warning mwilck
2020-07-09 10:16 ` [PATCH 17/35] libmultipath: remove uevent listener failback mwilck
2020-07-09 10:16 ` [PATCH 18/35] libmultipath: uevent: use static linkage where possible mwilck
2020-07-09 10:16 ` [PATCH 19/35] libmultipath: uevent: inline trivial functions mwilck
2020-07-09 10:16 ` [PATCH 20/35] libmultipath: decrease log level of "SCSI target" log message mwilck
2020-07-09 10:16 ` [PATCH 21/35] libmultipath: get_udev_uid(): more appropriate error code mwilck
2020-07-09 10:16 ` [PATCH 22/35] libmultipath: get_uid(): improve log message on udev failure mwilck
2020-07-09 10:16 ` [PATCH 23/35] libmultipath: make sysfs_pathinfo() static and use const mwilck
2020-07-09 10:16 ` [PATCH 24/35] libmultipath: pathinfo(): improve a log message mwilck
2020-07-09 10:16 ` [PATCH 25/35] libmultipath: pathinfo(): don't filter emtpy devnode names mwilck
2020-07-09 10:16 ` [PATCH 26/35] libmultipath: io_err_stat_handle_pathfail(): less error conditions mwilck
2020-07-09 10:16 ` [PATCH 27/35] libmultipath: improve libdm logging mwilck
2020-07-09 10:16 ` [PATCH 28/35] libmultipath: snprint_devices(): use udev_enumerate mwilck
2020-07-09 10:16 ` [PATCH 29/35] libmultipath: snprint_devices(): print hidden/foreign status mwilck
2020-07-09 10:16 ` [PATCH 30/35] libmultipath: alloc_path(): initialize pp->initialized mwilck
2020-07-09 10:16 ` [PATCH 31/35] libmultipath: alloc_path_with_pathinfo(): treat devname overflow as error mwilck
2020-07-09 10:16 ` [PATCH 32/35] libmultipath: log table params in addmap() mwilck
2020-07-09 10:16 ` [PATCH 33/35] multipathd: remove set_multipath_wwid() mwilck
2020-07-09 10:16 ` [PATCH 34/35] kpartx: print an error message if removing a partition fails mwilck
2020-07-09 10:16 ` [PATCH 35/35] kpartx: add missing newline mwilck
2020-07-20 21:09 ` [PATCH 00/35] multipath-tools series part I: minor changes Benjamin Marzinski
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=20200709101620.6786-14-mwilck@suse.com \
--to=mwilck@suse.com \
--cc=bmarzins@redhat.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@redhat.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.