diff mbox series

[1/4] xfs_db: pass const pointers when we're not modifying them

Message ID 173888089618.2742734.15049031959195578708.stgit@frogsfrogsfrogs (mailing list archive)
State Not Applicable, archived
Headers show
Series [1/4] xfs_db: pass const pointers when we're not modifying them | expand

Commit Message

Darrick J. Wong Feb. 6, 2025, 11:02 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Pass a const pointer to path_walk since we don't actually modify the
contents.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 db/namei.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christoph Hellwig Feb. 13, 2025, 4:29 a.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Andrey Albershteyn Feb. 13, 2025, 1:26 p.m. UTC | #2
On 2025-02-06 15:02:45, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Pass a const pointer to path_walk since we don't actually modify the
> contents.
> 
> Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>

Looks good to me
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>

> ---
>  db/namei.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/db/namei.c b/db/namei.c
> index 4eae4e8fd3232c..00610a54af527e 100644
> --- a/db/namei.c
> +++ b/db/namei.c
> @@ -140,10 +140,10 @@ path_navigate(
>  static int
>  path_walk(
>  	xfs_ino_t	rootino,
> -	char		*path)
> +	const char	*path)
>  {
>  	struct dirpath	*dirpath;
> -	char		*p = path;
> +	const char	*p = path;
>  	int		error = 0;
>  
>  	if (*p == '/') {
>
diff mbox series

Patch

diff --git a/db/namei.c b/db/namei.c
index 4eae4e8fd3232c..00610a54af527e 100644
--- a/db/namei.c
+++ b/db/namei.c
@@ -140,10 +140,10 @@  path_navigate(
 static int
 path_walk(
 	xfs_ino_t	rootino,
-	char		*path)
+	const char	*path)
 {
 	struct dirpath	*dirpath;
-	char		*p = path;
+	const char	*p = path;
 	int		error = 0;
 
 	if (*p == '/') {