From: Steve Dickson <steved@redhat.com>
To: Rudi Heitbaum <rudi@heitbaum.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] nfs-utils: mount.nfs: fix discards const from pointer target
Date: Tue, 24 Feb 2026 07:52:10 -0500 [thread overview]
Message-ID: <bed68038-34eb-4b08-92d0-06c2a1f817fa@redhat.com> (raw)
In-Reply-To: <aZFwJmiqqLgWYSl6@1eac07209f0d>
On 2/15/26 2:05 AM, Rudi Heitbaum wrote:
> dev is passed by nfs_parse_devname to nfs_parse_... as a copy of the
> device name, the parser destructively modifies dev, so pass as non const
> so that it can be modified without warning.
>
> fixes:
> parse_dev.c: In function 'nfs_parse_simple_hostname':
> parse_dev.c:89:15: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> 89 | colon = strchr(dev, ':');
> | ^
> parse_dev.c:100:15: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> 100 | comma = strchr(dev, ',');
> | ^
> parse_dev.c: In function 'nfs_parse_square_bracket':
> parse_dev.c:146:16: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> 146 | cbrace = strchr(dev, ']');
> | ^
>
> Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Committed... (tag: nfs-utils-2-8-6-rc2)
steved.
> ---
> utils/mount/parse_dev.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/utils/mount/parse_dev.c b/utils/mount/parse_dev.c
> index 2ade5d5d..a6354bba 100644
> --- a/utils/mount/parse_dev.c
> +++ b/utils/mount/parse_dev.c
> @@ -79,7 +79,7 @@ static int nfs_pdn_missing_brace_err(void)
> /*
> * Standard hostname:path format
> */
> -static int nfs_parse_simple_hostname(const char *dev,
> +static int nfs_parse_simple_hostname(char *dev,
> char **hostname, char **pathname)
> {
> size_t host_len, path_len;
> @@ -134,7 +134,7 @@ static int nfs_parse_simple_hostname(const char *dev,
> * There could be anything in between the brackets, but we'll
> * let DNS resolution sort it out later.
> */
> -static int nfs_parse_square_bracket(const char *dev,
> +static int nfs_parse_square_bracket(char *dev,
> char **hostname, char **pathname)
> {
> size_t host_len, path_len;
> @@ -185,7 +185,7 @@ static int nfs_parse_square_bracket(const char *dev,
> * with the mount request and failing with a cryptic error message
> * later.
> */
> -static int nfs_parse_nfs_url(__attribute__((unused)) const char *dev,
> +static int nfs_parse_nfs_url(__attribute__((unused)) char *dev,
> __attribute__((unused)) char **hostname,
> __attribute__((unused)) char **pathname)
> {
prev parent reply other threads:[~2026-02-24 12:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-15 7:05 [PATCH 1/2] nfs-utils: mount.nfs: fix discards const from pointer target Rudi Heitbaum
2026-02-24 12:52 ` Steve Dickson [this message]
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=bed68038-34eb-4b08-92d0-06c2a1f817fa@redhat.com \
--to=steved@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=rudi@heitbaum.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