mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* kstrtojunk
@ 2016-07-01  9:53 Alexey Dobriyan
  2016-07-01 13:57 ` kstrtojunk Kees Cook
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Dobriyan @ 2016-07-01  9:53 UTC (permalink / raw)
  To: Kees Cook; +Cc: Andrew Morton, Linux Kernel

Could you please stop converting to kstrtobool()?

commit a81a5a17d44b26521fb1199f8ccf27f4af337a67
Author: Kees Cook <keescook@chromium.org>
Date:   Thu Mar 17 14:22:57 2016 -0700

    lib: add "on"/"off" support to kstrtobool

Especially after doing patches like this?

How on earth this was accepted?

Now the kernel is supposed to know about every pair of words
with the opposite meaning and accept them.

If kstrtobool() is ever going to be added it should accept
only '0' and '1' characters because kernel is not there
to second guess (same logic applies to whitespace trimming
for proc/sysfs files).

Another point is that in C/C++ any value other than 0
is true in for bool but kstrtobool() doesn't accept, say '2'
as true. This is why it wasn't added in the first place.

It is amazing to see how people think that every 2 common
lines of code should be generalized and pushed into lib/.

  Alexey

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-04 21:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-01  9:53 kstrtojunk Alexey Dobriyan
2016-07-01 13:57 ` kstrtojunk Kees Cook
2016-07-04 21:26   ` kstrtojunk Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®