From: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
To: linux-raid@vger.kernel.org
Cc: jes@trained-monkey.org, mariusz.tkaczyk@linux.intel.com
Subject: [PATCH 1/2] util.c: change devnm to const in mdmon functions
Date: Tue, 7 May 2024 05:38:55 +0200 [thread overview]
Message-ID: <20240507033856.2195-2-kinga.stefaniuk@intel.com> (raw)
In-Reply-To: <20240507033856.2195-1-kinga.stefaniuk@intel.com>
Devnm shall not be changed inside mdmon_running()
and mdmon_pid() functions, change this parameter to const.
Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
---
mdadm.h | 4 ++--
util.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/mdadm.h b/mdadm.h
index ae2106a2f28f..af4c484afdf7 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -1767,8 +1767,8 @@ extern int is_subarray_active(char *subarray, char *devname);
extern int open_subarray(char *dev, char *subarray, struct supertype *st, int quiet);
extern struct superswitch *version_to_superswitch(char *vers);
-extern int mdmon_running(char *devnm);
-extern int mdmon_pid(char *devnm);
+extern int mdmon_running(const char *devnm);
+extern int mdmon_pid(const char *devnm);
extern int check_env(char *name);
extern __u32 random32(void);
extern void random_uuid(__u8 *buf);
diff --git a/util.c b/util.c
index 9e8370450a8d..65056a19e2cd 100644
--- a/util.c
+++ b/util.c
@@ -1891,7 +1891,7 @@ unsigned long long min_recovery_start(struct mdinfo *array)
return recovery_start;
}
-int mdmon_pid(char *devnm)
+int mdmon_pid(const char *devnm)
{
char path[100];
char pid[10];
@@ -1911,7 +1911,7 @@ int mdmon_pid(char *devnm)
return atoi(pid);
}
-int mdmon_running(char *devnm)
+int mdmon_running(const char *devnm)
{
int pid = mdmon_pid(devnm);
if (pid <= 0)
--
2.35.3
next prev parent reply other threads:[~2024-05-07 10:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 3:38 [PATCH 0/2] New timeout while waiting for mdmon Kinga Stefaniuk
2024-05-07 3:38 ` Kinga Stefaniuk [this message]
2024-05-07 3:38 ` [PATCH 2/2] Wait for mdmon when it is stared via systemd Kinga Stefaniuk
2024-05-14 9:17 ` Paul Menzel
2024-05-14 10:56 ` Kinga Stefaniuk
2024-05-07 4:28 ` [PATCH 0/2] New timeout while waiting for mdmon Paul E Luse
2024-05-08 7:22 ` Kinga Tanska
2024-05-14 9:09 ` Mariusz Tkaczyk
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=20240507033856.2195-2-kinga.stefaniuk@intel.com \
--to=kinga.stefaniuk@intel.com \
--cc=jes@trained-monkey.org \
--cc=linux-raid@vger.kernel.org \
--cc=mariusz.tkaczyk@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).