All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] soc: qcom: Introduce Protection Domain Restart helpers
@ 2020-03-18  9:47 Dan Carpenter
  2020-03-19 13:59 ` Sibi Sankar
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-03-18  9:47 UTC (permalink / raw)
  To: sibis; +Cc: linux-arm-msm

Hello Sibi Sankar,

The patch fbe639b44a82: "soc: qcom: Introduce Protection Domain
Restart helpers" from Mar 12, 2020, leads to the following static
checker warning:

	drivers/soc/qcom/pdr_interface.c:158 pdr_register_listener()
	warn: impossible condition '(resp.curr_state < (-((~0 >> 1)) - 1)) => (s32min-s32max < s32min)'

drivers/soc/qcom/pdr_interface.c
   145          ret = qmi_txn_wait(&txn, 5 * HZ);
   146          if (ret < 0) {
   147                  pr_err("PDR: %s register listener txn wait failed: %d\n",
   148                         pds->service_path, ret);
   149                  return ret;
   150          }
   151  
   152          if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
   153                  pr_err("PDR: %s register listener failed: 0x%x\n",
   154                         pds->service_path, resp.resp.error);
   155                  return ret;
   156          }
   157  
   158          if ((int)resp.curr_state < INT_MIN || (int)resp.curr_state > INT_MAX)
                    ^^^^                              ^^^^
These are casted to int so they can't be outside of int range.

   159                  pr_err("PDR: %s notification state invalid: 0x%x\n",
   160                         pds->service_path, resp.curr_state);
   161  
   162          pds->state = resp.curr_state;
   163  
   164          return 0;
   165  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] soc: qcom: Introduce Protection Domain Restart helpers
  2020-03-18  9:47 [bug report] soc: qcom: Introduce Protection Domain Restart helpers Dan Carpenter
@ 2020-03-19 13:59 ` Sibi Sankar
  0 siblings, 0 replies; 2+ messages in thread
From: Sibi Sankar @ 2020-03-19 13:59 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-arm-msm, linux-arm-msm-owner

Hey Dan,
Thanks for the bug report!
Will get the warning fixed

On 2020-03-18 15:17, Dan Carpenter wrote:
> Hello Sibi Sankar,
> 
> The patch fbe639b44a82: "soc: qcom: Introduce Protection Domain
> Restart helpers" from Mar 12, 2020, leads to the following static
> checker warning:
> 
> 	drivers/soc/qcom/pdr_interface.c:158 pdr_register_listener()
> 	warn: impossible condition '(resp.curr_state < (-((~0 >> 1)) - 1)) =>
> (s32min-s32max < s32min)'
> 
> drivers/soc/qcom/pdr_interface.c
>    145          ret = qmi_txn_wait(&txn, 5 * HZ);
>    146          if (ret < 0) {
>    147                  pr_err("PDR: %s register listener txn wait
> failed: %d\n",
>    148                         pds->service_path, ret);
>    149                  return ret;
>    150          }
>    151
>    152          if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
>    153                  pr_err("PDR: %s register listener failed: 
> 0x%x\n",
>    154                         pds->service_path, resp.resp.error);
>    155                  return ret;
>    156          }
>    157
>    158          if ((int)resp.curr_state < INT_MIN ||
> (int)resp.curr_state > INT_MAX)
>                     ^^^^                              ^^^^
> These are casted to int so they can't be outside of int range.
> 
>    159                  pr_err("PDR: %s notification state invalid: 
> 0x%x\n",
>    160                         pds->service_path, resp.curr_state);
>    161
>    162          pds->state = resp.curr_state;
>    163
>    164          return 0;
>    165  }
> 
> regards,
> dan carpenter

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-19 13:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-18  9:47 [bug report] soc: qcom: Introduce Protection Domain Restart helpers Dan Carpenter
2020-03-19 13:59 ` Sibi Sankar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.