* [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once
@ 2014-06-25 14:01 Rickard Strandqvist
2014-06-25 15:34 ` Maurizio Lombardi
2014-06-26 8:09 ` Jack Wang
0 siblings, 2 replies; 6+ messages in thread
From: Rickard Strandqvist @ 2014-06-25 14:01 UTC (permalink / raw)
To: xjtuwjp, lindar_liu
Cc: Rickard Strandqvist, James E.J. Bottomley, linux-scsi,
linux-kernel
A struct member variable is set to different values without having used in between.
This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
drivers/scsi/pm8001/pm80xx_hwi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index d70587f..2698227 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -249,7 +249,6 @@ moreData:
sprintf(pm8001_ha->
forensic_info.data_buf.direct_data,
"%08x ", 4);
- pm8001_ha->forensic_info.data_buf.read_len = 0xFFFFFFFF;
pm8001_ha->forensic_info.data_buf.direct_len = 0;
pm8001_ha->forensic_info.data_buf.direct_offset = 0;
pm8001_ha->forensic_info.data_buf.read_len = 0;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once
2014-06-25 14:01 [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once Rickard Strandqvist
@ 2014-06-25 15:34 ` Maurizio Lombardi
[not found] ` <CAN7X1Un3-u-Q428-s1dYk5z4P-Bb=jO-N+x1T+PLhH1fDE1MRw@mail.gmail.com>
2014-06-26 8:09 ` Jack Wang
1 sibling, 1 reply; 6+ messages in thread
From: Maurizio Lombardi @ 2014-06-25 15:34 UTC (permalink / raw)
To: Rickard Strandqvist, xjtuwjp, lindar_liu
Cc: James E.J. Bottomley, linux-scsi, linux-kernel
This one looks good to me,
Reviewed-by: Maurizio Lombardi <mlombard@redhat.com>
On 06/25/2014 04:01 PM, Rickard Strandqvist wrote:
> A struct member variable is set to different values without having used in between.
>
> This was found using a static code analysis program called cppcheck
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
> drivers/scsi/pm8001/pm80xx_hwi.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index d70587f..2698227 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -249,7 +249,6 @@ moreData:
> sprintf(pm8001_ha->
> forensic_info.data_buf.direct_data,
> "%08x ", 4);
> - pm8001_ha->forensic_info.data_buf.read_len = 0xFFFFFFFF;
> pm8001_ha->forensic_info.data_buf.direct_len = 0;
> pm8001_ha->forensic_info.data_buf.direct_offset = 0;
> pm8001_ha->forensic_info.data_buf.read_len = 0;
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once
[not found] ` <CAN7X1Un3-u-Q428-s1dYk5z4P-Bb=jO-N+x1T+PLhH1fDE1MRw@mail.gmail.com>
@ 2014-06-25 16:08 ` Maurizio Lombardi
0 siblings, 0 replies; 6+ messages in thread
From: Maurizio Lombardi @ 2014-06-25 16:08 UTC (permalink / raw)
To: Purush Gupta
Cc: Rickard Strandqvist, xjtuwjp, lindar_liu, James E.J. Bottomley,
linux-scsi, Linux Kernel List
Hi,
On 06/25/2014 05:41 PM, Purush Gupta wrote:
> Its possible HW may require programming those fields?
I'm looking at the code and it doesn't look so, did you see something suspicious?
> May be original
> contributor of the driver should review...No offense!
I believe it requires the maintainer ACK and it takes precedence in any case, am I wrong?
Regards,
Maurizio Lombardi
>
> thanks,
> Purush
>
>
> On Wed, Jun 25, 2014 at 8:34 AM, Maurizio Lombardi <mlombard@redhat.com>
> wrote:
>
>> This one looks good to me,
>>
>> Reviewed-by: Maurizio Lombardi <mlombard@redhat.com>
>>
>> On 06/25/2014 04:01 PM, Rickard Strandqvist wrote:
>>> A struct member variable is set to different values without having used
>> in between.
>>>
>>> This was found using a static code analysis program called cppcheck
>>>
>>> Signed-off-by: Rickard Strandqvist <
>> rickard_strandqvist@spectrumdigital.se>
>>> ---
>>> drivers/scsi/pm8001/pm80xx_hwi.c | 1 -
>>> 1 file changed, 1 deletion(-)
>>>
>>> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c
>> b/drivers/scsi/pm8001/pm80xx_hwi.c
>>> index d70587f..2698227 100644
>>> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
>>> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
>>> @@ -249,7 +249,6 @@ moreData:
>>> sprintf(pm8001_ha->
>>> forensic_info.data_buf.direct_data,
>>> "%08x ", 4);
>>> - pm8001_ha->forensic_info.data_buf.read_len =
>> 0xFFFFFFFF;
>>> pm8001_ha->forensic_info.data_buf.direct_len = 0;
>>> pm8001_ha->forensic_info.data_buf.direct_offset =
>> 0;
>>> pm8001_ha->forensic_info.data_buf.read_len = 0;
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once
2014-06-25 14:01 [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once Rickard Strandqvist
2014-06-25 15:34 ` Maurizio Lombardi
@ 2014-06-26 8:09 ` Jack Wang
2014-06-26 8:20 ` Maurizio Lombardi
2014-06-27 9:06 ` Suresh Thiagarajan
1 sibling, 2 replies; 6+ messages in thread
From: Jack Wang @ 2014-06-26 8:09 UTC (permalink / raw)
To: Rickard Strandqvist, Anand Kumar Santhanam
Cc: lindar_liu, James E.J. Bottomley, linux-scsi, linux-kernel
Thanks Rickard,
>From my point of view, looks good, but I'd like to get review from Anand
(cc-ed).
Anand, could you share your opinion?
Regards,
Jack
On 06/25/2014 04:01 PM, Rickard Strandqvist wrote:
> A struct member variable is set to different values without having used in between.
>
> This was found using a static code analysis program called cppcheck
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
> drivers/scsi/pm8001/pm80xx_hwi.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index d70587f..2698227 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -249,7 +249,6 @@ moreData:
> sprintf(pm8001_ha->
> forensic_info.data_buf.direct_data,
> "%08x ", 4);
> - pm8001_ha->forensic_info.data_buf.read_len = 0xFFFFFFFF;
> pm8001_ha->forensic_info.data_buf.direct_len = 0;
> pm8001_ha->forensic_info.data_buf.direct_offset = 0;
> pm8001_ha->forensic_info.data_buf.read_len = 0;
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once
2014-06-26 8:09 ` Jack Wang
@ 2014-06-26 8:20 ` Maurizio Lombardi
2014-06-27 9:06 ` Suresh Thiagarajan
1 sibling, 0 replies; 6+ messages in thread
From: Maurizio Lombardi @ 2014-06-26 8:20 UTC (permalink / raw)
To: Jack Wang, Rickard Strandqvist, Anand Kumar Santhanam
Cc: lindar_liu, James E.J. Bottomley, linux-scsi, linux-kernel
On 06/26/2014 10:09 AM, Jack Wang wrote:
> Thanks Rickard,
>
> From my point of view, looks good, but I'd like to get review from Anand
> (cc-ed).
I would like to add that I noticed that this fields is only set and appears to be never used,
maybe it could be completely removed.
Regards,
Maurizio Lombardi
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once
2014-06-26 8:09 ` Jack Wang
2014-06-26 8:20 ` Maurizio Lombardi
@ 2014-06-27 9:06 ` Suresh Thiagarajan
1 sibling, 0 replies; 6+ messages in thread
From: Suresh Thiagarajan @ 2014-06-27 9:06 UTC (permalink / raw)
To: Jack Wang, Rickard Strandqvist
Cc: lindar_liu@usish.com, James E.J. Bottomley,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
On Thu, Jun 26, 2014 at 1:50 PM, Maurizio Lombardi <mlombard@redhat.com> wrote:
> On 06/26/2014 10:09 AM, Jack Wang wrote:
>> Thanks Rickard,
>>
>> From my point of view, looks good, but I'd like to get review from Anand
>> (cc-ed).
>
> I would like to add that I noticed that this fields is only set and appears to be never used,
> maybe it could be completely removed.
You are correct. The whole forensic_info structure itself is not used or referred anywhere. I will remove it and send a patch.
Regards,
Suresh Thiagarajan
>
> Regards,
> Maurizio Lombardi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-06-27 9:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-25 14:01 [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once Rickard Strandqvist
2014-06-25 15:34 ` Maurizio Lombardi
[not found] ` <CAN7X1Un3-u-Q428-s1dYk5z4P-Bb=jO-N+x1T+PLhH1fDE1MRw@mail.gmail.com>
2014-06-25 16:08 ` Maurizio Lombardi
2014-06-26 8:09 ` Jack Wang
2014-06-26 8:20 ` Maurizio Lombardi
2014-06-27 9:06 ` Suresh Thiagarajan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox