intel / intel-cmt-cat

User space software for Intel(R) Resource Director Technology
http://www.intel.com/content/www/us/en/architecture-and-technology/resource-director-technology.html
Other
685 stars 180 forks source link

lib/os_cap.c: remove duplicated declaration of variable supported #233

Closed ColinIanKing closed 1 year ago

ColinIanKing commented 1 year ago

Variable supported is being declared a second time in a local scope and is name shadowing the previous declaration. The local scoped variable can be safely removed to use the outer scoped one instead.

Signed-off-by: Colin Ian King colin.i.king@gmail.com

Description

cppcheck reported variable name shadowing:

lib/os_cap.c:445:21: style: Local variable 'supported' shadows outer variable [shadowVariable]
                int supported; 
                    ^          
lib/os_cap.c:403:13: note: Shadowed declaration
        int supported;
            ^            
lib/os_cap.c:445:21: note: Shadow variable
                int supported; 

Remove local scoped declaration, this is OK because the variable is never used afterwards.

Affected parts

Motivation and Context

Cleans up a cppcheck warning. No functional changes.

How Has This Been Tested?

Build tested only

Types of changes

Checklist:

aleksinx commented 1 year ago

Thanks for your contribution! This change has been merged in this commit.