• B
    cpufreq: make table sentinel macros unsigned to match use · 2b1987a9
    Brian W Hart 提交于
    Commit 5eeaf1f1 (cpufreq: Fix build error on some platforms that
    use cpufreq_for_each_*) moved function cpufreq_next_valid() to a public
    header.  Warnings are now generated when objects including that header
    are built with -Wsign-compare (as an out-of-tree module might be):
    
    .../include/linux/cpufreq.h: In function ‘cpufreq_next_valid’:
    .../include/linux/cpufreq.h:519:27: warning: comparison between signed
    and unsigned integer expressions [-Wsign-compare]
      while ((*pos)->frequency != CPUFREQ_TABLE_END)
                               ^
    .../include/linux/cpufreq.h:520:25: warning: comparison between signed
    and unsigned integer expressions [-Wsign-compare]
       if ((*pos)->frequency != CPUFREQ_ENTRY_INVALID)
                             ^
    
    Constants CPUFREQ_ENTRY_INVALID and CPUFREQ_TABLE_END are signed, but
    are used with unsigned member 'frequency' of cpufreq_frequency_table.
    Update the macro definitions to be explicitly unsigned to match their
    use.
    
    This also corrects potentially wrong behavior of clk_rate_table_iter()
    if unsigned long is wider than usigned int.
    
    Fixes: 5eeaf1f1 (cpufreq: Fix build error on some platforms that use cpufreq_for_each_*)
    Signed-off-by: NBrian W Hart <hartb@linux.vnet.ibm.com>
    Reviewed-by: NSimon Horman <horms+renesas@verge.net.au>
    Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
    2b1987a9
cpufreq.h 18.8 KB