lkml.org 
[lkml]   [2019]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v7 01/15] sched/core: uclamp: Add CPU's clamp buckets refcounting
    On Wed, Mar 13, 2019 at 04:12:29PM +0000, Patrick Bellasi wrote:
    > Yes, the for looks better, but perhaps like that:
    >
    > unsigned int bucket_id = UCLAMP_BUCKETS;
    >
    > /*
    > * Both min and max clamps are MAX aggregated, thus the topmost
    > * bucket with some tasks defines the rq's clamp value.
    > */
    > for (; bucket_id >= 0; --bucket_id) {

    GCC will be clever and figure that unsigned will never be smaller than 0
    and turn the above into an infinite loop or something daft.

    That is; use 'int', not 'unsigned int' for bucket_id.

    \
     
     \ /
      Last update: 2019-03-13 18:23    [W:3.142 / U:1.160 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site