Bug 80361

Summary: metag/kernel/cachepart.c:102: bad way to test for failure ?
Product: Platform Specific/Hardware Reporter: David Binderman (dcb314)
Component: OtherAssignee: platform_other
Status: NEW ---    
Severity: normal CC: andrey_utkin
Priority: P1    
Hardware: Other   
OS: Linux   
Kernel Version: 3.16-rc5 Subsystem:
Regression: No Bisected commit-id:

Description David Binderman 2014-07-16 17:05:32 UTC
[linux-3.16-rc5/arch/metag/kernel/cachepart.c:102]: (style) Checking if unsigned variable 'thread_cache_size' is less than zero.

Source code is

        if (thread_cache_size < 0)
            pr_emerg("Can't read %s cache size\n",
                 cache_type ? "DCACHE" : "ICACHE");

but

    unsigned int thread_cache_size;

Function get_thread_cache_size returns an error code
as (unsigned int) -1. 

Maybe it would be better to test for that ?
Comment 1 Andrey Utkin 2014-07-17 13:31:18 UTC
Thanks, patch submitted: https://patchwork.kernel.org/patch/4575011/