fix(zynqmp): evaluate condition for boolean

This corrects the MISRA violation C2012-11.9:
The macro NULL shall be the only permitted form of integer
null pointer constant.
The condition is compared with NULL to get boolean result.

Change-Id: I6350e2c03fdb3175deb232f28f0dfce009563eb1
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
This commit is contained in:
Maheedhar Bollapalli 2024-04-19 13:13:03 +05:30
parent aba5bf901d
commit aaf6e7627e
2 changed files with 9 additions and 9 deletions

View file

@ -2791,7 +2791,7 @@ enum pm_ret_status pm_clock_get_pll_node_id(enum clock_id clock_id,
{
struct pm_pll *pll = pm_clock_get_pll(clock_id);
if (pll) {
if (pll != NULL) {
*node_id = pll->nid;
return PM_RET_SUCCESS;
}
@ -2883,7 +2883,7 @@ enum pm_ret_status pm_clock_pll_get_state(struct pm_pll *pll,
enum pm_ret_status status;
enum pm_pll_mode mode;
if ((pll == NULL) || !state) {
if ((pll == NULL) || (state == NULL)) {
return PM_RET_ERROR_ARGS;
}
@ -3013,7 +3013,7 @@ enum pm_ret_status pm_clock_get_pll_mode(enum clock_id clock_id,
{
struct pm_pll *pll = pm_clock_get_pll(clock_id);
if ((pll == NULL) || !mode) {
if ((pll == NULL) || (mode == NULL)) {
return PM_RET_ERROR_ARGS;
}
*mode = pll->mode;

View file

@ -1150,7 +1150,7 @@ enum pm_ret_status pm_clock_enable(uint32_t clock_id)
/* First try to handle it as a PLL */
pll = pm_clock_get_pll(clock_id);
if (pll) {
if (pll != NULL) {
return pm_clock_pll_enable(pll);
}
@ -1175,7 +1175,7 @@ enum pm_ret_status pm_clock_disable(uint32_t clock_id)
/* First try to handle it as a PLL */
pll = pm_clock_get_pll(clock_id);
if (pll) {
if (pll != NULL) {
return pm_clock_pll_disable(pll);
}
@ -1203,9 +1203,9 @@ enum pm_ret_status pm_clock_getstate(uint32_t clock_id,
/* First try to handle it as a PLL */
pll = pm_clock_get_pll(clock_id);
if (pll)
if (pll != NULL) {
return pm_clock_pll_get_state(pll, state);
}
/* Check if clock ID is a valid on-chip clock */
status = pm_clock_id_is_valid(clock_id);
if (status != PM_RET_SUCCESS) {
@ -1341,7 +1341,7 @@ enum pm_ret_status pm_clock_setparent(uint32_t clock_id,
/* First try to handle it as a PLL */
pll = pm_clock_get_pll_by_related_clk(clock_id);
if (pll) {
if (pll != NULL) {
return pm_clock_pll_set_parent(pll, clock_id, parent_index);
}
@ -1376,7 +1376,7 @@ enum pm_ret_status pm_clock_getparent(uint32_t clock_id,
/* First try to handle it as a PLL */
pll = pm_clock_get_pll_by_related_clk(clock_id);
if (pll) {
if (pll != NULL) {
return pm_clock_pll_get_parent(pll, clock_id, parent_index);
}