lkml.org 
[lkml]   [2015]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] kernel-sched: Delete an unnecessary check before unregister_sysctl_table()
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Sat, 4 Jul 2015 09:06:32 +0200

    The unregister_sysctl_table() function tests whether its argument is NULL
    and then returns immediately. Thus the test around the call is not needed.

    This issue was detected by using the Coccinelle software.

    Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    ---
    kernel/sched/core.c | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/kernel/sched/core.c b/kernel/sched/core.c
    index b803e1b..4756d1c 100644
    --- a/kernel/sched/core.c
    +++ b/kernel/sched/core.c
    @@ -5298,8 +5298,7 @@ static void register_sched_domain_sysctl(void)
    /* may be called multiple times per register */
    static void unregister_sched_domain_sysctl(void)
    {
    - if (sd_sysctl_header)
    - unregister_sysctl_table(sd_sysctl_header);
    + unregister_sysctl_table(sd_sysctl_header);
    sd_sysctl_header = NULL;
    if (sd_ctl_dir[0].child)
    sd_free_ctl_entry(&sd_ctl_dir[0].child);
    --
    2.4.5


    \
     
     \ /
      Last update: 2015-07-05 11:41    [W:7.749 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site