lkml.org 
[lkml]   [2014]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/3] sched: idle: Encapsulate the code to compile it out
    On Thu, 24 Apr 2014, Daniel Lezcano wrote:

    > Encapsulate the large portion of cpuidle_idle_call inside another
    > function so when CONFIG_CPU_IDLE=n, the code will be compiled out.
    > Also that is benefitial for the clarity of the code as it removes
    > a nested indentation level.

    I agree with the nesting level concern.

    However I dislike the proliferation of #ifdef's in the main code. Those
    added in this patch are unnecessary. We want as much compilation
    coverage as possible.

    With cpuidle_enabled() already hardcoded to return -ENODEV when
    CONFIG_CPU_IDLE=n, the compiler should already be smart enough to
    optimize away all the redundant code in that case. You may look at the
    assembly output from the compiler if you're not sure.

    And if you're still not trusting the compiler then the second best
    option is to use IS_ENABLED(CONFIG_CPU_IDLE) inside some if statement.


    Nicolas


    \
     
     \ /
      Last update: 2014-04-30 20:21    [W:2.695 / U:0.136 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site