LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] reset: reset-zynqmp: Fixed the argument data type
@ 2021-06-23 11:46 Michal Simek
2021-08-06 10:25 ` Michal Simek
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Michal Simek @ 2021-06-23 11:46 UTC (permalink / raw)
To: linux-kernel, monstr, michal.simek, git
Cc: Sai Krishna Potthuri, Philipp Zabel, linux-arm-kernel
From: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
This patch changes the data type of the variable 'val' from
int to u32.
Addresses-Coverity: argument of type "int *" is incompatible with parameter of type "u32 *"
Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/reset/reset-zynqmp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/reset/reset-zynqmp.c b/drivers/reset/reset-zynqmp.c
index daa425e74c96..59dc0ff9af9e 100644
--- a/drivers/reset/reset-zynqmp.c
+++ b/drivers/reset/reset-zynqmp.c
@@ -53,7 +53,8 @@ static int zynqmp_reset_status(struct reset_controller_dev *rcdev,
unsigned long id)
{
struct zynqmp_reset_data *priv = to_zynqmp_reset_data(rcdev);
- int val, err;
+ int err;
+ u32 val;
err = zynqmp_pm_reset_get_status(priv->data->reset_id + id, &val);
if (err)
--
2.32.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] reset: reset-zynqmp: Fixed the argument data type
2021-06-23 11:46 [PATCH] reset: reset-zynqmp: Fixed the argument data type Michal Simek
@ 2021-08-06 10:25 ` Michal Simek
2021-08-11 10:36 ` Michael Tretter
2021-08-23 10:56 ` Philipp Zabel
2 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2021-08-06 10:25 UTC (permalink / raw)
To: LKML, Michal Simek, git; +Cc: Sai Krishna Potthuri, Philipp Zabel, linux-arm
Hi Philipp,
st 23. 6. 2021 v 13:46 odesílatel Michal Simek <michal.simek@xilinx.com> napsal:
>
> From: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
>
> This patch changes the data type of the variable 'val' from
> int to u32.
>
> Addresses-Coverity: argument of type "int *" is incompatible with parameter of type "u32 *"
> Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> drivers/reset/reset-zynqmp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/reset/reset-zynqmp.c b/drivers/reset/reset-zynqmp.c
> index daa425e74c96..59dc0ff9af9e 100644
> --- a/drivers/reset/reset-zynqmp.c
> +++ b/drivers/reset/reset-zynqmp.c
> @@ -53,7 +53,8 @@ static int zynqmp_reset_status(struct reset_controller_dev *rcdev,
> unsigned long id)
> {
> struct zynqmp_reset_data *priv = to_zynqmp_reset_data(rcdev);
> - int val, err;
> + int err;
> + u32 val;
>
> err = zynqmp_pm_reset_get_status(priv->data->reset_id + id, &val);
> if (err)
> --
> 2.32.0
>
Can you please take a look at this patch?
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] reset: reset-zynqmp: Fixed the argument data type
2021-06-23 11:46 [PATCH] reset: reset-zynqmp: Fixed the argument data type Michal Simek
2021-08-06 10:25 ` Michal Simek
@ 2021-08-11 10:36 ` Michael Tretter
2021-08-11 11:29 ` Michal Simek
2021-08-23 10:56 ` Philipp Zabel
2 siblings, 1 reply; 5+ messages in thread
From: Michael Tretter @ 2021-08-11 10:36 UTC (permalink / raw)
To: Michal Simek
Cc: linux-kernel, monstr, git, Sai Krishna Potthuri, Philipp Zabel,
linux-arm-kernel, kernel
On Wed, 23 Jun 2021 13:46:20 +0200, Michal Simek wrote:
> From: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
>
> This patch changes the data type of the variable 'val' from
> int to u32.
>
> Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> Addresses-Coverity: argument of type "int *" is incompatible with parameter of type "u32 *"
> ---
>
> drivers/reset/reset-zynqmp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/reset/reset-zynqmp.c b/drivers/reset/reset-zynqmp.c
> index daa425e74c96..59dc0ff9af9e 100644
> --- a/drivers/reset/reset-zynqmp.c
> +++ b/drivers/reset/reset-zynqmp.c
> @@ -53,7 +53,8 @@ static int zynqmp_reset_status(struct reset_controller_dev *rcdev,
> unsigned long id)
> {
> struct zynqmp_reset_data *priv = to_zynqmp_reset_data(rcdev);
> - int val, err;
> + int err;
> + u32 val;
The function returns val as int instead of u32. While this shouldn't be a
problem in this case, maybe there should be an additional check just to be
sure?
Michael
>
> err = zynqmp_pm_reset_get_status(priv->data->reset_id + id, &val);
> if (err)
> --
> 2.32.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] reset: reset-zynqmp: Fixed the argument data type
2021-08-11 10:36 ` Michael Tretter
@ 2021-08-11 11:29 ` Michal Simek
0 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2021-08-11 11:29 UTC (permalink / raw)
To: Michael Tretter, Michal Simek
Cc: linux-kernel, monstr, git, Sai Krishna Potthuri, Philipp Zabel,
linux-arm-kernel, kernel
On 8/11/21 12:36 PM, Michael Tretter wrote:
> On Wed, 23 Jun 2021 13:46:20 +0200, Michal Simek wrote:
>> From: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
>>
>> This patch changes the data type of the variable 'val' from
>> int to u32.
>>
>> Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> Addresses-Coverity: argument of type "int *" is incompatible with parameter of type "u32 *"
>> ---
>>
>> drivers/reset/reset-zynqmp.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/reset/reset-zynqmp.c b/drivers/reset/reset-zynqmp.c
>> index daa425e74c96..59dc0ff9af9e 100644
>> --- a/drivers/reset/reset-zynqmp.c
>> +++ b/drivers/reset/reset-zynqmp.c
>> @@ -53,7 +53,8 @@ static int zynqmp_reset_status(struct reset_controller_dev *rcdev,
>> unsigned long id)
>> {
>> struct zynqmp_reset_data *priv = to_zynqmp_reset_data(rcdev);
>> - int val, err;
>> + int err;
>> + u32 val;
>
> The function returns val as int instead of u32. While this shouldn't be a
> problem in this case, maybe there should be an additional check just to be
> sure?
As far as I can tell coverity is not reporting any issue around it.
And when I look at internal of that function in firmware this function
in case of success returns only 0 or 1 that's why I don't think we need
to do anything with it.
Thanks,
Michal
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] reset: reset-zynqmp: Fixed the argument data type
2021-06-23 11:46 [PATCH] reset: reset-zynqmp: Fixed the argument data type Michal Simek
2021-08-06 10:25 ` Michal Simek
2021-08-11 10:36 ` Michael Tretter
@ 2021-08-23 10:56 ` Philipp Zabel
2 siblings, 0 replies; 5+ messages in thread
From: Philipp Zabel @ 2021-08-23 10:56 UTC (permalink / raw)
To: Michal Simek, linux-kernel, monstr, git
Cc: Sai Krishna Potthuri, linux-arm-kernel
Hi Michal,
On Wed, 2021-06-23 at 13:46 +0200, Michal Simek wrote:
> From: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
>
> This patch changes the data type of the variable 'val' from
> int to u32.
>
> Addresses-Coverity: argument of type "int *" is incompatible with parameter of type "u32 *"
> Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> drivers/reset/reset-zynqmp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/reset/reset-zynqmp.c b/drivers/reset/reset-zynqmp.c
> index daa425e74c96..59dc0ff9af9e 100644
> --- a/drivers/reset/reset-zynqmp.c
> +++ b/drivers/reset/reset-zynqmp.c
> @@ -53,7 +53,8 @@ static int zynqmp_reset_status(struct reset_controller_dev *rcdev,
> unsigned long id)
> {
> struct zynqmp_reset_data *priv = to_zynqmp_reset_data(rcdev);
> - int val, err;
> + int err;
> + u32 val;
>
> err = zynqmp_pm_reset_get_status(priv->data->reset_id + id, &val);
> if (err)
Thank you, applied to reset/fixes.
regards
Philipp
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-08-23 10:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 11:46 [PATCH] reset: reset-zynqmp: Fixed the argument data type Michal Simek
2021-08-06 10:25 ` Michal Simek
2021-08-11 10:36 ` Michael Tretter
2021-08-11 11:29 ` Michal Simek
2021-08-23 10:56 ` Philipp Zabel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).