Re: [PATCH 1/2] filesetup: make longest_existing_path() static and const-correct

Vincent Fu <[email protected]> Thu, 31 Jul 2025 12:20:17 -0400
Newsgroups org.kernel.vger.fio
Message-ID <[email protected]>
On 7/31/25 8:20 AM, Tomas Winkler wrote:
> Mark longest_existing_path() as static since it is only used within
> filesetup.c. Also, declare the 'path' parameter as const char *
> because it is not modified within the function.
> 
> Signed-off-by: Tomas Winkler [email protected]
> ---
>   filesetup.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/filesetup.c b/filesetup.c
> index a94d3b38..bcbd871e 100644
> --- a/filesetup.c
> +++ b/filesetup.c
> @@ -1002,7 +1002,8 @@ uint64_t get_start_offset(struct thread_data *td, struct fio_file *f)
>   /*
>    * Find longest path component that exists and return its length
>    */
> -int longest_existing_path(char *path) {
> +static int longest_existing_path(const char *path)
> +{
>   	char buf[PATH_MAX];
>   	bool done;
>   	char *buf_pos;

Applied. Thanks. Next time when you post more than one patch please 
include a cover letter.

Vincent