kstrtox: Remove strtobool()

Message ID 23d2ea6b90579207e87cc1bf64fc4eed1ed9f173.1689885328.git.christophe.jaillet@wanadoo.fr
State New
Headers
Series kstrtox: Remove strtobool() |

Commit Message

Christophe JAILLET July 20, 2023, 8:40 p.m. UTC
  The conversion from strtobool() to kstrtobool() is completed.
So strtobool() can now be removed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Unless I missed something, the last strtobool() calls have been removed
from -next just 1 or 2 days ago.

So it is maybe good to wait a few days or weeks to apply this patch in
order not to break something somewhere.

For now, see if build-bots agree with me :)


get_maintainer.pl is of now help here, so adding just Andrew Morton, and
Andy Shevchenko (who splitted out this file from kernel.h)
---
 include/linux/kstrtox.h | 5 -----
 1 file changed, 5 deletions(-)
  

Comments

Andy Shevchenko July 21, 2023, 10:22 a.m. UTC | #1
On Thu, Jul 20, 2023 at 10:40:35PM +0200, Christophe JAILLET wrote:
> The conversion from strtobool() to kstrtobool() is completed.
> So strtobool() can now be removed.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Unless I missed something, the last strtobool() calls have been removed
> from -next just 1 or 2 days ago.
> 
> So it is maybe good to wait a few days or weeks to apply this patch in
> order not to break something somewhere.
> 
> For now, see if build-bots agree with me :)

> get_maintainer.pl is of now help here, so adding just Andrew Morton, and
> Andy Shevchenko (who splitted out this file from kernel.h)

Kees Cook from recent times.

As this is about Linux Next, you need to talk to Torvalds to apply this before
v6.6-rc1.

Code wise it's good, feel free to add:
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  
Andrew Morton July 24, 2023, 6:05 p.m. UTC | #2
On Thu, 20 Jul 2023 22:40:35 +0200 Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:

> The conversion from strtobool() to kstrtobool() is completed.
> So strtobool() can now be removed.

I still have some strtobool()s in mm.git, so I can't apply this. 

Probably nobody can apply this to their tree at this stage.  A resend
after 6.6-rc1 would be the simplest approach.
  
Christophe JAILLET July 24, 2023, 7:16 p.m. UTC | #3
Le 24/07/2023 à 20:05, Andrew Morton a écrit :
> On Thu, 20 Jul 2023 22:40:35 +0200 Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:
> 
>> The conversion from strtobool() to kstrtobool() is completed.
>> So strtobool() can now be removed.
> 
> I still have some strtobool()s in mm.git, so I can't apply this.
> 
> Probably nobody can apply this to their tree at this stage.  A resend
> after 6.6-rc1 would be the simplest approach.
> 
> 

Let's do it then.

Note that in -next there is still some strtobool but only in tools/.
I thinks it is ok to leave it as-is.


git grep -w strtobool

tools/include/linux/string.h:int strtobool(const char *s, bool *res);
tools/lib/string.c: *  More specifically, the first copied function was 
strtobool, which
tools/lib/string.c: *  d0f1fed29e6e ("Add a strtobool function matching 
semantics of existing in kernel equivalents")
tools/lib/string.c: * strtobool - convert common user inputs into 
boolean values
tools/lib/string.c:int strtobool(const char *s, bool *res)
tools/perf/util/bpf-loader.c:   err = strtobool(value, &bool_value);


CJ
  

Patch

diff --git a/include/linux/kstrtox.h b/include/linux/kstrtox.h
index 529974e22ea7..7fcf29a4e0de 100644
--- a/include/linux/kstrtox.h
+++ b/include/linux/kstrtox.h
@@ -147,9 +147,4 @@  extern long simple_strtol(const char *,char **,unsigned int);
 extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
 extern long long simple_strtoll(const char *,char **,unsigned int);
 
-static inline int strtobool(const char *s, bool *res)
-{
-	return kstrtobool(s, res);
-}
-
 #endif	/* _LINUX_KSTRTOX_H */