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

pqos: alloc: remove redundant null check on pointer ids #234

Closed ColinIanKing closed 1 year ago

ColinIanKing commented 1 year ago

The pointer ids is being redundantly null checked in a few places, ids has already been null checked in earlier return paths. Note that null checking on a free of null is also redundant since free won't attempt to free a null pointer.

Cleans up static analysis warning from cppcheck: Checking pqos/alloc.c ... pqos/alloc.c:482:44: style: Condition 'ids!=NULL' is always true [knownConditionTrueFalse] if (res_ids == NULL && ids != NULL) ^ pqos/alloc.c:496:44: style: Condition 'ids!=NULL' is always true [knownConditionTrueFalse] if (res_ids == NULL && ids != NULL) ^ pqos/alloc.c:508:36: style: Condition 'ids!=NULL' is always true [knownConditionTrueFalse] if (res_ids == NULL && ids != NULL)

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

Description

Affected parts

Motivation and Context

How Has This Been Tested?

Types of changes

Checklist: