lkml.org 
[lkml]   [2022]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 26/30] s390/ipl: Use kstrtobool() instead of strtobool()
    Date
    strtobool() is the same as kstrtobool().
    However, the latter is more used within the kernel.

    In order to remove strtobool() and slightly simplify kstrtox.h, switch to
    the other function name.

    While at it, include the corresponding header file (<linux/kstrtox.h>)

    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    ---
    This patch is part of a serie that axes all usages of strtobool().
    Each patch can be applied independently from the other ones.

    The last patch of the serie removes the definition of strtobool().

    You may not be in copy of the cover letter. So, if needed, it is available
    at [1].


    This patch has NOT been compile tested.


    [1]: https://lore.kernel.org/all/cover.1667336095.git.christophe.jaillet@wanadoo.fr/
    ---
    arch/s390/kernel/ipl.c | 7 ++++---
    1 file changed, 4 insertions(+), 3 deletions(-)

    diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
    index 325cbf69ebbd..cdd575d7a91a 100644
    --- a/arch/s390/kernel/ipl.c
    +++ b/arch/s390/kernel/ipl.c
    @@ -12,6 +12,7 @@
    #include <linux/init.h>
    #include <linux/device.h>
    #include <linux/delay.h>
    +#include <linux/kstrtox.h>
    #include <linux/panic_notifier.h>
    #include <linux/reboot.h>
    #include <linux/ctype.h>
    @@ -779,7 +780,7 @@ static ssize_t reipl_fcp_clear_store(struct kobject *kobj,
    struct kobj_attribute *attr,
    const char *buf, size_t len)
    {
    - if (strtobool(buf, &reipl_fcp_clear) < 0)
    + if (kstrtobool(buf, &reipl_fcp_clear) < 0)
    return -EINVAL;
    return len;
    }
    @@ -899,7 +900,7 @@ static ssize_t reipl_nvme_clear_store(struct kobject *kobj,
    struct kobj_attribute *attr,
    const char *buf, size_t len)
    {
    - if (strtobool(buf, &reipl_nvme_clear) < 0)
    + if (kstrtobool(buf, &reipl_nvme_clear) < 0)
    return -EINVAL;
    return len;
    }
    @@ -952,7 +953,7 @@ static ssize_t reipl_ccw_clear_store(struct kobject *kobj,
    struct kobj_attribute *attr,
    const char *buf, size_t len)
    {
    - if (strtobool(buf, &reipl_ccw_clear) < 0)
    + if (kstrtobool(buf, &reipl_ccw_clear) < 0)
    return -EINVAL;
    return len;
    }
    --
    2.34.1
    \
     
     \ /
      Last update: 2022-11-01 22:17    [W:3.919 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site