All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: Michael Tretter <m.tretter@pengutronix.de>,
	Michal Simek <michal.simek@xilinx.com>
Cc: <linux-kernel@vger.kernel.org>, <monstr@monstr.eu>,
	<git@xilinx.com>,
	"Sai Krishna Potthuri" <lakshmi.sai.krishna.potthuri@xilinx.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	<linux-arm-kernel@lists.infradead.org>, <kernel@pengutronix.de>
Subject: Re: [PATCH] reset: reset-zynqmp: Fixed the argument data type
Date: Wed, 11 Aug 2021 13:29:40 +0200	[thread overview]
Message-ID: <d3bdc4c8-1e31-e1ac-e192-c7bff74eb4af@xilinx.com> (raw)
In-Reply-To: <20210811103621.GA23827@pengutronix.de>



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

WARNING: multiple messages have this Message-ID (diff)
From: Michal Simek <michal.simek@xilinx.com>
To: Michael Tretter <m.tretter@pengutronix.de>,
	Michal Simek <michal.simek@xilinx.com>
Cc: <linux-kernel@vger.kernel.org>, <monstr@monstr.eu>,
	<git@xilinx.com>,
	"Sai Krishna Potthuri" <lakshmi.sai.krishna.potthuri@xilinx.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	<linux-arm-kernel@lists.infradead.org>, <kernel@pengutronix.de>
Subject: Re: [PATCH] reset: reset-zynqmp: Fixed the argument data type
Date: Wed, 11 Aug 2021 13:29:40 +0200	[thread overview]
Message-ID: <d3bdc4c8-1e31-e1ac-e192-c7bff74eb4af@xilinx.com> (raw)
In-Reply-To: <20210811103621.GA23827@pengutronix.de>



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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-08-11 11:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23 11:46 [PATCH] reset: reset-zynqmp: Fixed the argument data type Michal Simek
2021-06-23 11:46 ` Michal Simek
2021-08-06 10:25 ` Michal Simek
2021-08-06 10:25   ` Michal Simek
2021-08-11 10:36 ` Michael Tretter
2021-08-11 10:36   ` Michael Tretter
2021-08-11 11:29   ` Michal Simek [this message]
2021-08-11 11:29     ` Michal Simek
2021-08-23 10:56 ` Philipp Zabel
2021-08-23 10:56   ` Philipp Zabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d3bdc4c8-1e31-e1ac-e192-c7bff74eb4af@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=git@xilinx.com \
    --cc=kernel@pengutronix.de \
    --cc=lakshmi.sai.krishna.potthuri@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.tretter@pengutronix.de \
    --cc=monstr@monstr.eu \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.