2015-11-18 18:07:28

by Nicolas Iooss

[permalink] [raw]
Subject: [PATCH] fixdep: constify strrcmp arguments

strrcmp only performs read access to the memory addressed by its
arguments so make them const pointers.

Signed-off-by: Nicolas Iooss <[email protected]>
---
scripts/basic/fixdep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index c68fd61fdc42..5b327c67a828 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -251,7 +251,7 @@ static void parse_config_file(const char *map, size_t len)
}

/* test is s ends in sub */
-static int strrcmp(char *s, char *sub)
+static int strrcmp(const char *s, const char *sub)
{
int slen = strlen(s);
int sublen = strlen(sub);
--
2.6.2


2015-12-05 09:43:40

by Nicolas Iooss

[permalink] [raw]
Subject: Re: [PATCH] fixdep: constify strrcmp arguments

Hello,
I sent the path below a few weeks ago and did not have any feedback.
Could you please review it?

Thanks,
Nicolas

On 11/18/2015 07:07 PM, Nicolas Iooss wrote:
> strrcmp only performs read access to the memory addressed by its
> arguments so make them const pointers.
>
> Signed-off-by: Nicolas Iooss <[email protected]>
> ---
> scripts/basic/fixdep.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
> index c68fd61fdc42..5b327c67a828 100644
> --- a/scripts/basic/fixdep.c
> +++ b/scripts/basic/fixdep.c
> @@ -251,7 +251,7 @@ static void parse_config_file(const char *map, size_t len)
> }
>
> /* test is s ends in sub */
> -static int strrcmp(char *s, char *sub)
> +static int strrcmp(const char *s, const char *sub)
> {
> int slen = strlen(s);
> int sublen = strlen(sub);
>

2015-12-07 13:03:11

by Michal Marek

[permalink] [raw]
Subject: Re: [PATCH] fixdep: constify strrcmp arguments

On 2015-12-05 10:43, Nicolas Iooss wrote:
> Hello,
> I sent the path below a few weeks ago and did not have any feedback.
> Could you please review it?

Applied to kbuild.git#kbuild now.

Michal