* [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined
@ 2019-03-28 23:43 Colin King
2019-03-29 8:16 ` Jinpu Wang
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Colin King @ 2019-03-28 23:43 UTC (permalink / raw)
To: Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, linux-scsi
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
When macro PM8001_USE_MSIX is defined there are redundant dead code
calls to pm8001_chip_intx_interrupt_{enable|disable}. Clean this up
by compiling in the appropriate enable/disable handlers for the
defined PM8001_USE_MSIX and undefined PM8001_USE_MSIX cases.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/scsi/pm8001/pm8001_hwi.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index e4209091c1da..7d81246a432b 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -1204,6 +1204,7 @@ void pm8001_chip_iounmap(struct pm8001_hba_info *pm8001_ha)
}
}
+#ifndef PM8001_USE_MSIX
/**
* pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
* @pm8001_ha: our hba card information
@@ -1225,6 +1226,8 @@ pm8001_chip_intx_interrupt_disable(struct pm8001_hba_info *pm8001_ha)
pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL);
}
+#else
+
/**
* pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt
* @pm8001_ha: our hba card information
@@ -1256,6 +1259,7 @@ pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha,
msi_index += MSIX_TABLE_BASE;
pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_DISABLE);
}
+#endif
/**
* pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
@@ -1266,10 +1270,9 @@ pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
{
#ifdef PM8001_USE_MSIX
pm8001_chip_msix_interrupt_enable(pm8001_ha, 0);
- return;
-#endif
+#else
pm8001_chip_intx_interrupt_enable(pm8001_ha);
-
+#endif
}
/**
@@ -1281,10 +1284,9 @@ pm8001_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec)
{
#ifdef PM8001_USE_MSIX
pm8001_chip_msix_interrupt_disable(pm8001_ha, 0);
- return;
-#endif
+#else
pm8001_chip_intx_interrupt_disable(pm8001_ha);
-
+#endif
}
/**
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined
2019-03-28 23:43 [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined Colin King
@ 2019-03-29 8:16 ` Jinpu Wang
2019-03-29 10:41 ` Mukesh Ojha
2019-03-29 14:14 ` Martin K. Petersen
2 siblings, 0 replies; 14+ messages in thread
From: Jinpu Wang @ 2019-03-29 8:16 UTC (permalink / raw)
To: Colin King
Cc: Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, Linux SCSI Mailinglist, kernel-janitors,
linux-kernel
On Fri, Mar 29, 2019 at 12:43 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> When macro PM8001_USE_MSIX is defined there are redundant dead code
> calls to pm8001_chip_intx_interrupt_{enable|disable}. Clean this up
> by compiling in the appropriate enable/disable handlers for the
> defined PM8001_USE_MSIX and undefined PM8001_USE_MSIX cases.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Thanks, Colin,
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
> ---
> drivers/scsi/pm8001/pm8001_hwi.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
> index e4209091c1da..7d81246a432b 100644
> --- a/drivers/scsi/pm8001/pm8001_hwi.c
> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
> @@ -1204,6 +1204,7 @@ void pm8001_chip_iounmap(struct pm8001_hba_info *pm8001_ha)
> }
> }
>
> +#ifndef PM8001_USE_MSIX
> /**
> * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
> * @pm8001_ha: our hba card information
> @@ -1225,6 +1226,8 @@ pm8001_chip_intx_interrupt_disable(struct pm8001_hba_info *pm8001_ha)
> pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL);
> }
>
> +#else
> +
> /**
> * pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt
> * @pm8001_ha: our hba card information
> @@ -1256,6 +1259,7 @@ pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha,
> msi_index += MSIX_TABLE_BASE;
> pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_DISABLE);
> }
> +#endif
>
> /**
> * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
> @@ -1266,10 +1270,9 @@ pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
> {
> #ifdef PM8001_USE_MSIX
> pm8001_chip_msix_interrupt_enable(pm8001_ha, 0);
> - return;
> -#endif
> +#else
> pm8001_chip_intx_interrupt_enable(pm8001_ha);
> -
> +#endif
> }
>
> /**
> @@ -1281,10 +1284,9 @@ pm8001_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec)
> {
> #ifdef PM8001_USE_MSIX
> pm8001_chip_msix_interrupt_disable(pm8001_ha, 0);
> - return;
> -#endif
> +#else
> pm8001_chip_intx_interrupt_disable(pm8001_ha);
> -
> +#endif
> }
>
> /**
> --
> 2.20.1
>
--
Jack Wang
Linux Kernel Developer
1&1 IONOS Cloud GmbH | Greifswalder Str. 207 | 10405 Berlin | Germany
Phone: +49 30 57700-8042 | Fax: +49 30 57700-8598
E-mail: jinpu.wang@cloud.ionos.com | Web: www.ionos.de
Head Office: Berlin, Germany
District Court Berlin Charlottenburg, Registration number: HRB 125506 B
Executive Management: Christoph Steffens, Matthias Steinberg, Achim Weiss
Member of United Internet
This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient of this e-mail, you are hereby
notified that saving, distribution or use of the content of this
e-mail in any way is prohibited. If you have received this e-mail in
error, please notify the sender and delete the e-mail.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined
@ 2019-03-29 8:16 ` Jinpu Wang
0 siblings, 0 replies; 14+ messages in thread
From: Jinpu Wang @ 2019-03-29 8:16 UTC (permalink / raw)
To: Colin King
Cc: Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, Linux SCSI Mailinglist, kernel-janitors,
linux-kernel
On Fri, Mar 29, 2019 at 12:43 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> When macro PM8001_USE_MSIX is defined there are redundant dead code
> calls to pm8001_chip_intx_interrupt_{enable|disable}. Clean this up
> by compiling in the appropriate enable/disable handlers for the
> defined PM8001_USE_MSIX and undefined PM8001_USE_MSIX cases.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Thanks, Colin,
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
> ---
> drivers/scsi/pm8001/pm8001_hwi.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
> index e4209091c1da..7d81246a432b 100644
> --- a/drivers/scsi/pm8001/pm8001_hwi.c
> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
> @@ -1204,6 +1204,7 @@ void pm8001_chip_iounmap(struct pm8001_hba_info *pm8001_ha)
> }
> }
>
> +#ifndef PM8001_USE_MSIX
> /**
> * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
> * @pm8001_ha: our hba card information
> @@ -1225,6 +1226,8 @@ pm8001_chip_intx_interrupt_disable(struct pm8001_hba_info *pm8001_ha)
> pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL);
> }
>
> +#else
> +
> /**
> * pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt
> * @pm8001_ha: our hba card information
> @@ -1256,6 +1259,7 @@ pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha,
> msi_index += MSIX_TABLE_BASE;
> pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_DISABLE);
> }
> +#endif
>
> /**
> * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
> @@ -1266,10 +1270,9 @@ pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
> {
> #ifdef PM8001_USE_MSIX
> pm8001_chip_msix_interrupt_enable(pm8001_ha, 0);
> - return;
> -#endif
> +#else
> pm8001_chip_intx_interrupt_enable(pm8001_ha);
> -
> +#endif
> }
>
> /**
> @@ -1281,10 +1284,9 @@ pm8001_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec)
> {
> #ifdef PM8001_USE_MSIX
> pm8001_chip_msix_interrupt_disable(pm8001_ha, 0);
> - return;
> -#endif
> +#else
> pm8001_chip_intx_interrupt_disable(pm8001_ha);
> -
> +#endif
> }
>
> /**
> --
> 2.20.1
>
--
Jack Wang
Linux Kernel Developer
1&1 IONOS Cloud GmbH | Greifswalder Str. 207 | 10405 Berlin | Germany
Phone: +49 30 57700-8042 | Fax: +49 30 57700-8598
E-mail: jinpu.wang@cloud.ionos.com | Web: www.ionos.de
Head Office: Berlin, Germany
District Court Berlin Charlottenburg, Registration number: HRB 125506 B
Executive Management: Christoph Steffens, Matthias Steinberg, Achim Weiss
Member of United Internet
This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient of this e-mail, you are hereby
notified that saving, distribution or use of the content of this
e-mail in any way is prohibited. If you have received this e-mail in
error, please notify the sender and delete the e-mail.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined
2019-03-28 23:43 [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined Colin King
@ 2019-03-29 10:41 ` Mukesh Ojha
2019-03-29 10:41 ` Mukesh Ojha
2019-03-29 14:14 ` Martin K. Petersen
2 siblings, 0 replies; 14+ messages in thread
From: Mukesh Ojha @ 2019-03-29 10:29 UTC (permalink / raw)
To: Colin King, Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, linux-scsi
Cc: kernel-janitors, linux-kernel
On 3/29/2019 5:13 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> When macro PM8001_USE_MSIX is defined there are redundant dead code
> calls to pm8001_chip_intx_interrupt_{enable|disable}. Clean this up
> by compiling in the appropriate enable/disable handlers for the
> defined PM8001_USE_MSIX and undefined PM8001_USE_MSIX cases.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
This looks good.
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Not relevant to this patch but Can you do something about
pm8001_chip_is_our_interupt() as well ?
Cheers,
-Mukesh
> ---
> drivers/scsi/pm8001/pm8001_hwi.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
> index e4209091c1da..7d81246a432b 100644
> --- a/drivers/scsi/pm8001/pm8001_hwi.c
> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
> @@ -1204,6 +1204,7 @@ void pm8001_chip_iounmap(struct pm8001_hba_info *pm8001_ha)
> }
> }
>
> +#ifndef PM8001_USE_MSIX
> /**
> * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
> * @pm8001_ha: our hba card information
> @@ -1225,6 +1226,8 @@ pm8001_chip_intx_interrupt_disable(struct pm8001_hba_info *pm8001_ha)
> pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL);
> }
>
> +#else
> +
> /**
> * pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt
> * @pm8001_ha: our hba card information
> @@ -1256,6 +1259,7 @@ pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha,
> msi_index += MSIX_TABLE_BASE;
> pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_DISABLE);
> }
> +#endif
>
> /**
> * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
> @@ -1266,10 +1270,9 @@ pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
> {
> #ifdef PM8001_USE_MSIX
> pm8001_chip_msix_interrupt_enable(pm8001_ha, 0);
> - return;
> -#endif
> +#else
> pm8001_chip_intx_interrupt_enable(pm8001_ha);
> -
> +#endif
> }
>
> /**
> @@ -1281,10 +1284,9 @@ pm8001_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec)
> {
> #ifdef PM8001_USE_MSIX
> pm8001_chip_msix_interrupt_disable(pm8001_ha, 0);
> - return;
> -#endif
> +#else
> pm8001_chip_intx_interrupt_disable(pm8001_ha);
> -
> +#endif
> }
>
> /**
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined
2019-03-29 10:41 ` Mukesh Ojha
(?)
@ 2019-03-29 10:38 ` Colin Ian King
-1 siblings, 0 replies; 14+ messages in thread
From: Colin Ian King @ 2019-03-29 10:38 UTC (permalink / raw)
To: Mukesh Ojha, Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, linux-scsi
Cc: kernel-janitors, linux-kernel
On 29/03/2019 10:29, Mukesh Ojha wrote:
>
> On 3/29/2019 5:13 AM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> When macro PM8001_USE_MSIX is defined there are redundant dead code
>> calls to pm8001_chip_intx_interrupt_{enable|disable}. Clean this up
>> by compiling in the appropriate enable/disable handlers for the
>> defined PM8001_USE_MSIX and undefined PM8001_USE_MSIX cases.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
>
> This looks good.
>
> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
>
>
> Not relevant to this patch but Can you do something about
> pm8001_chip_is_our_interupt() as well ?
Ah, yes, I missed that one, will do that sometime today.
>
>
> Cheers,
> -Mukesh
>> ---
>> drivers/scsi/pm8001/pm8001_hwi.c | 14 ++++++++------
>> 1 file changed, 8 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c
>> b/drivers/scsi/pm8001/pm8001_hwi.c
>> index e4209091c1da..7d81246a432b 100644
>> --- a/drivers/scsi/pm8001/pm8001_hwi.c
>> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
>> @@ -1204,6 +1204,7 @@ void pm8001_chip_iounmap(struct pm8001_hba_info
>> *pm8001_ha)
>> }
>> }
>> +#ifndef PM8001_USE_MSIX
>> /**
>> * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
>> * @pm8001_ha: our hba card information
>> @@ -1225,6 +1226,8 @@ pm8001_chip_intx_interrupt_disable(struct
>> pm8001_hba_info *pm8001_ha)
>> pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL);
>> }
>> +#else
>> +
>> /**
>> * pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt
>> * @pm8001_ha: our hba card information
>> @@ -1256,6 +1259,7 @@ pm8001_chip_msix_interrupt_disable(struct
>> pm8001_hba_info *pm8001_ha,
>> msi_index += MSIX_TABLE_BASE;
>> pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_DISABLE);
>> }
>> +#endif
>> /**
>> * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
>> @@ -1266,10 +1270,9 @@ pm8001_chip_interrupt_enable(struct
>> pm8001_hba_info *pm8001_ha, u8 vec)
>> {
>> #ifdef PM8001_USE_MSIX
>> pm8001_chip_msix_interrupt_enable(pm8001_ha, 0);
>> - return;
>> -#endif
>> +#else
>> pm8001_chip_intx_interrupt_enable(pm8001_ha);
>> -
>> +#endif
>> }
>> /**
>> @@ -1281,10 +1284,9 @@ pm8001_chip_interrupt_disable(struct
>> pm8001_hba_info *pm8001_ha, u8 vec)
>> {
>> #ifdef PM8001_USE_MSIX
>> pm8001_chip_msix_interrupt_disable(pm8001_ha, 0);
>> - return;
>> -#endif
>> +#else
>> pm8001_chip_intx_interrupt_disable(pm8001_ha);
>> -
>> +#endif
>> }
>> /**
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined
@ 2019-03-29 10:41 ` Mukesh Ojha
0 siblings, 0 replies; 14+ messages in thread
From: Mukesh Ojha @ 2019-03-29 10:41 UTC (permalink / raw)
To: Colin King, Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, linux-scsi
Cc: kernel-janitors, linux-kernel
On 3/29/2019 5:13 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> When macro PM8001_USE_MSIX is defined there are redundant dead code
> calls to pm8001_chip_intx_interrupt_{enable|disable}. Clean this up
> by compiling in the appropriate enable/disable handlers for the
> defined PM8001_USE_MSIX and undefined PM8001_USE_MSIX cases.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
This looks good.
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Not relevant to this patch but Can you do something about
pm8001_chip_is_our_interupt() as well ?
Cheers,
-Mukesh
> ---
> drivers/scsi/pm8001/pm8001_hwi.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
> index e4209091c1da..7d81246a432b 100644
> --- a/drivers/scsi/pm8001/pm8001_hwi.c
> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
> @@ -1204,6 +1204,7 @@ void pm8001_chip_iounmap(struct pm8001_hba_info *pm8001_ha)
> }
> }
>
> +#ifndef PM8001_USE_MSIX
> /**
> * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
> * @pm8001_ha: our hba card information
> @@ -1225,6 +1226,8 @@ pm8001_chip_intx_interrupt_disable(struct pm8001_hba_info *pm8001_ha)
> pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL);
> }
>
> +#else
> +
> /**
> * pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt
> * @pm8001_ha: our hba card information
> @@ -1256,6 +1259,7 @@ pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha,
> msi_index += MSIX_TABLE_BASE;
> pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_DISABLE);
> }
> +#endif
>
> /**
> * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
> @@ -1266,10 +1270,9 @@ pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
> {
> #ifdef PM8001_USE_MSIX
> pm8001_chip_msix_interrupt_enable(pm8001_ha, 0);
> - return;
> -#endif
> +#else
> pm8001_chip_intx_interrupt_enable(pm8001_ha);
> -
> +#endif
> }
>
> /**
> @@ -1281,10 +1284,9 @@ pm8001_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec)
> {
> #ifdef PM8001_USE_MSIX
> pm8001_chip_msix_interrupt_disable(pm8001_ha, 0);
> - return;
> -#endif
> +#else
> pm8001_chip_intx_interrupt_disable(pm8001_ha);
> -
> +#endif
> }
>
> /**
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined
2019-03-28 23:43 [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined Colin King
@ 2019-03-29 14:14 ` Martin K. Petersen
2019-03-29 10:41 ` Mukesh Ojha
2019-03-29 14:14 ` Martin K. Petersen
2 siblings, 0 replies; 14+ messages in thread
From: Martin K. Petersen @ 2019-03-29 14:14 UTC (permalink / raw)
To: Colin King
Cc: Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, linux-scsi, kernel-janitors, linux-kernel
Colin,
> When macro PM8001_USE_MSIX is defined there are redundant dead code
> calls to pm8001_chip_intx_interrupt_{enable|disable}. Clean this up by
> compiling in the appropriate enable/disable handlers for the defined
> PM8001_USE_MSIX and undefined PM8001_USE_MSIX cases.
Applied to 5.2/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined
@ 2019-03-29 14:14 ` Martin K. Petersen
0 siblings, 0 replies; 14+ messages in thread
From: Martin K. Petersen @ 2019-03-29 14:14 UTC (permalink / raw)
To: Colin King
Cc: Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, linux-scsi, kernel-janitors, linux-kernel
Colin,
> When macro PM8001_USE_MSIX is defined there are redundant dead code
> calls to pm8001_chip_intx_interrupt_{enable|disable}. Clean this up by
> compiling in the appropriate enable/disable handlers for the defined
> PM8001_USE_MSIX and undefined PM8001_USE_MSIX cases.
Applied to 5.2/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined (part2)
2019-03-28 23:43 [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined Colin King
@ 2019-03-29 15:32 ` Colin King
2019-03-29 10:41 ` Mukesh Ojha
2019-03-29 14:14 ` Martin K. Petersen
2 siblings, 0 replies; 14+ messages in thread
From: Colin King @ 2019-03-29 15:32 UTC (permalink / raw)
To: Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, linux-scsi
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
When macro PM8001_USE_MSIX is defined there is redundant dead code
call to pm8001_cr32. Clean this up for the defined PM8001_USE_MSIX and
undefined PM8001_USE_MSIX cases.
Also rename the functions pm8001_chip_is_our_interupt,
pm80xx_chip_is_our_interupt and function pointer is_our_interrupt
to fix spelling mistakes.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/scsi/pm8001/pm8001_hwi.c | 11 ++++++-----
drivers/scsi/pm8001/pm8001_init.c | 4 ++--
drivers/scsi/pm8001/pm8001_sas.h | 2 +-
drivers/scsi/pm8001/pm80xx_hwi.c | 11 ++++++-----
4 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index e4209091c1da..627075d00918 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -4623,17 +4623,18 @@ static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
return ret;
}
-static u32 pm8001_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha)
+static u32 pm8001_chip_is_our_interrupt(struct pm8001_hba_info *pm8001_ha)
{
- u32 value;
#ifdef PM8001_USE_MSIX
return 1;
-#endif
+#else
+ u32 value;
+
value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
if (value)
return 1;
return 0;
-
+#endif
}
/**
@@ -5119,7 +5120,7 @@ const struct pm8001_dispatch pm8001_8001_dispatch = {
.chip_rst = pm8001_hw_chip_rst,
.chip_iounmap = pm8001_chip_iounmap,
.isr = pm8001_chip_isr,
- .is_our_interupt = pm8001_chip_is_our_interupt,
+ .is_our_interrupt = pm8001_chip_is_our_interrupt,
.isr_process_oq = process_oq,
.interrupt_enable = pm8001_chip_interrupt_enable,
.interrupt_disable = pm8001_chip_interrupt_disable,
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index a36060c23b37..3374f553c617 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -201,7 +201,7 @@ static irqreturn_t pm8001_interrupt_handler_msix(int irq, void *opaque)
if (unlikely(!pm8001_ha))
return IRQ_NONE;
- if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha))
+ if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha))
return IRQ_NONE;
#ifdef PM8001_USE_TASKLET
tasklet_schedule(&pm8001_ha->tasklet[irq_vector->irq_id]);
@@ -224,7 +224,7 @@ static irqreturn_t pm8001_interrupt_handler_intx(int irq, void *dev_id)
pm8001_ha = sha->lldd_ha;
if (unlikely(!pm8001_ha))
return IRQ_NONE;
- if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha))
+ if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha))
return IRQ_NONE;
#ifdef PM8001_USE_TASKLET
diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h
index f88b0d33c385..ac6d8e3f22de 100644
--- a/drivers/scsi/pm8001/pm8001_sas.h
+++ b/drivers/scsi/pm8001/pm8001_sas.h
@@ -197,7 +197,7 @@ struct pm8001_dispatch {
int (*chip_ioremap)(struct pm8001_hba_info *pm8001_ha);
void (*chip_iounmap)(struct pm8001_hba_info *pm8001_ha);
irqreturn_t (*isr)(struct pm8001_hba_info *pm8001_ha, u8 vec);
- u32 (*is_our_interupt)(struct pm8001_hba_info *pm8001_ha);
+ u32 (*is_our_interrupt)(struct pm8001_hba_info *pm8001_ha);
int (*isr_process_oq)(struct pm8001_hba_info *pm8001_ha, u8 vec);
void (*interrupt_enable)(struct pm8001_hba_info *pm8001_ha, u8 vec);
void (*interrupt_disable)(struct pm8001_hba_info *pm8001_ha, u8 vec);
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 536d2b4384f8..301de40eb708 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -4617,17 +4617,18 @@ static int pm80xx_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
return pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
}
-static u32 pm80xx_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha)
+static u32 pm80xx_chip_is_our_interrupt(struct pm8001_hba_info *pm8001_ha)
{
- u32 value;
#ifdef PM8001_USE_MSIX
return 1;
-#endif
+#else
+ u32 value;
+
value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
if (value)
return 1;
return 0;
-
+#endif
}
/**
@@ -4724,7 +4725,7 @@ const struct pm8001_dispatch pm8001_80xx_dispatch = {
.chip_rst = pm80xx_hw_chip_rst,
.chip_iounmap = pm8001_chip_iounmap,
.isr = pm80xx_chip_isr,
- .is_our_interupt = pm80xx_chip_is_our_interupt,
+ .is_our_interrupt = pm80xx_chip_is_our_interrupt,
.isr_process_oq = process_oq,
.interrupt_enable = pm80xx_chip_interrupt_enable,
.interrupt_disable = pm80xx_chip_interrupt_disable,
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined (part2)
@ 2019-03-29 15:32 ` Colin King
0 siblings, 0 replies; 14+ messages in thread
From: Colin King @ 2019-03-29 15:32 UTC (permalink / raw)
To: Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, linux-scsi
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
When macro PM8001_USE_MSIX is defined there is redundant dead code
call to pm8001_cr32. Clean this up for the defined PM8001_USE_MSIX and
undefined PM8001_USE_MSIX cases.
Also rename the functions pm8001_chip_is_our_interupt,
pm80xx_chip_is_our_interupt and function pointer is_our_interrupt
to fix spelling mistakes.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/scsi/pm8001/pm8001_hwi.c | 11 ++++++-----
drivers/scsi/pm8001/pm8001_init.c | 4 ++--
drivers/scsi/pm8001/pm8001_sas.h | 2 +-
drivers/scsi/pm8001/pm80xx_hwi.c | 11 ++++++-----
4 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index e4209091c1da..627075d00918 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -4623,17 +4623,18 @@ static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
return ret;
}
-static u32 pm8001_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha)
+static u32 pm8001_chip_is_our_interrupt(struct pm8001_hba_info *pm8001_ha)
{
- u32 value;
#ifdef PM8001_USE_MSIX
return 1;
-#endif
+#else
+ u32 value;
+
value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
if (value)
return 1;
return 0;
-
+#endif
}
/**
@@ -5119,7 +5120,7 @@ const struct pm8001_dispatch pm8001_8001_dispatch = {
.chip_rst = pm8001_hw_chip_rst,
.chip_iounmap = pm8001_chip_iounmap,
.isr = pm8001_chip_isr,
- .is_our_interupt = pm8001_chip_is_our_interupt,
+ .is_our_interrupt = pm8001_chip_is_our_interrupt,
.isr_process_oq = process_oq,
.interrupt_enable = pm8001_chip_interrupt_enable,
.interrupt_disable = pm8001_chip_interrupt_disable,
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index a36060c23b37..3374f553c617 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -201,7 +201,7 @@ static irqreturn_t pm8001_interrupt_handler_msix(int irq, void *opaque)
if (unlikely(!pm8001_ha))
return IRQ_NONE;
- if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha))
+ if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha))
return IRQ_NONE;
#ifdef PM8001_USE_TASKLET
tasklet_schedule(&pm8001_ha->tasklet[irq_vector->irq_id]);
@@ -224,7 +224,7 @@ static irqreturn_t pm8001_interrupt_handler_intx(int irq, void *dev_id)
pm8001_ha = sha->lldd_ha;
if (unlikely(!pm8001_ha))
return IRQ_NONE;
- if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha))
+ if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha))
return IRQ_NONE;
#ifdef PM8001_USE_TASKLET
diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h
index f88b0d33c385..ac6d8e3f22de 100644
--- a/drivers/scsi/pm8001/pm8001_sas.h
+++ b/drivers/scsi/pm8001/pm8001_sas.h
@@ -197,7 +197,7 @@ struct pm8001_dispatch {
int (*chip_ioremap)(struct pm8001_hba_info *pm8001_ha);
void (*chip_iounmap)(struct pm8001_hba_info *pm8001_ha);
irqreturn_t (*isr)(struct pm8001_hba_info *pm8001_ha, u8 vec);
- u32 (*is_our_interupt)(struct pm8001_hba_info *pm8001_ha);
+ u32 (*is_our_interrupt)(struct pm8001_hba_info *pm8001_ha);
int (*isr_process_oq)(struct pm8001_hba_info *pm8001_ha, u8 vec);
void (*interrupt_enable)(struct pm8001_hba_info *pm8001_ha, u8 vec);
void (*interrupt_disable)(struct pm8001_hba_info *pm8001_ha, u8 vec);
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 536d2b4384f8..301de40eb708 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -4617,17 +4617,18 @@ static int pm80xx_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
return pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
}
-static u32 pm80xx_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha)
+static u32 pm80xx_chip_is_our_interrupt(struct pm8001_hba_info *pm8001_ha)
{
- u32 value;
#ifdef PM8001_USE_MSIX
return 1;
-#endif
+#else
+ u32 value;
+
value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
if (value)
return 1;
return 0;
-
+#endif
}
/**
@@ -4724,7 +4725,7 @@ const struct pm8001_dispatch pm8001_80xx_dispatch = {
.chip_rst = pm80xx_hw_chip_rst,
.chip_iounmap = pm8001_chip_iounmap,
.isr = pm80xx_chip_isr,
- .is_our_interupt = pm80xx_chip_is_our_interupt,
+ .is_our_interrupt = pm80xx_chip_is_our_interrupt,
.isr_process_oq = process_oq,
.interrupt_enable = pm80xx_chip_interrupt_enable,
.interrupt_disable = pm80xx_chip_interrupt_disable,
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined (part2)
2019-03-29 15:32 ` Colin King
@ 2019-03-29 20:20 ` Mukesh Ojha
-1 siblings, 0 replies; 14+ messages in thread
From: Mukesh Ojha @ 2019-03-29 20:08 UTC (permalink / raw)
To: Colin King, Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, linux-scsi
Cc: kernel-janitors, linux-kernel
On 3/29/2019 9:02 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> When macro PM8001_USE_MSIX is defined there is redundant dead code
> call to pm8001_cr32. Clean this up for the defined PM8001_USE_MSIX and
> undefined PM8001_USE_MSIX cases.
>
> Also rename the functions pm8001_chip_is_our_interupt,
> pm80xx_chip_is_our_interupt and function pointer is_our_interrupt
> to fix spelling mistakes.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
It would be better if you could split this into two patch, one for dead
code and other for renaming.
Otherwise change looks good.
Once you fix above you could include .
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Cheers,
-Mukesh
> ---
> drivers/scsi/pm8001/pm8001_hwi.c | 11 ++++++-----
> drivers/scsi/pm8001/pm8001_init.c | 4 ++--
> drivers/scsi/pm8001/pm8001_sas.h | 2 +-
> drivers/scsi/pm8001/pm80xx_hwi.c | 11 ++++++-----
> 4 files changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
> index e4209091c1da..627075d00918 100644
> --- a/drivers/scsi/pm8001/pm8001_hwi.c
> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
> @@ -4623,17 +4623,18 @@ static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
> return ret;
> }
>
> -static u32 pm8001_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha)
> +static u32 pm8001_chip_is_our_interrupt(struct pm8001_hba_info *pm8001_ha)
> {
> - u32 value;
> #ifdef PM8001_USE_MSIX
> return 1;
> -#endif
> +#else
> + u32 value;
> +
> value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
> if (value)
> return 1;
> return 0;
> -
> +#endif
> }
>
> /**
> @@ -5119,7 +5120,7 @@ const struct pm8001_dispatch pm8001_8001_dispatch = {
> .chip_rst = pm8001_hw_chip_rst,
> .chip_iounmap = pm8001_chip_iounmap,
> .isr = pm8001_chip_isr,
> - .is_our_interupt = pm8001_chip_is_our_interupt,
> + .is_our_interrupt = pm8001_chip_is_our_interrupt,
> .isr_process_oq = process_oq,
> .interrupt_enable = pm8001_chip_interrupt_enable,
> .interrupt_disable = pm8001_chip_interrupt_disable,
> diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
> index a36060c23b37..3374f553c617 100644
> --- a/drivers/scsi/pm8001/pm8001_init.c
> +++ b/drivers/scsi/pm8001/pm8001_init.c
> @@ -201,7 +201,7 @@ static irqreturn_t pm8001_interrupt_handler_msix(int irq, void *opaque)
>
> if (unlikely(!pm8001_ha))
> return IRQ_NONE;
> - if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha))
> + if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha))
> return IRQ_NONE;
> #ifdef PM8001_USE_TASKLET
> tasklet_schedule(&pm8001_ha->tasklet[irq_vector->irq_id]);
> @@ -224,7 +224,7 @@ static irqreturn_t pm8001_interrupt_handler_intx(int irq, void *dev_id)
> pm8001_ha = sha->lldd_ha;
> if (unlikely(!pm8001_ha))
> return IRQ_NONE;
> - if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha))
> + if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha))
> return IRQ_NONE;
>
> #ifdef PM8001_USE_TASKLET
> diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h
> index f88b0d33c385..ac6d8e3f22de 100644
> --- a/drivers/scsi/pm8001/pm8001_sas.h
> +++ b/drivers/scsi/pm8001/pm8001_sas.h
> @@ -197,7 +197,7 @@ struct pm8001_dispatch {
> int (*chip_ioremap)(struct pm8001_hba_info *pm8001_ha);
> void (*chip_iounmap)(struct pm8001_hba_info *pm8001_ha);
> irqreturn_t (*isr)(struct pm8001_hba_info *pm8001_ha, u8 vec);
> - u32 (*is_our_interupt)(struct pm8001_hba_info *pm8001_ha);
> + u32 (*is_our_interrupt)(struct pm8001_hba_info *pm8001_ha);
> int (*isr_process_oq)(struct pm8001_hba_info *pm8001_ha, u8 vec);
> void (*interrupt_enable)(struct pm8001_hba_info *pm8001_ha, u8 vec);
> void (*interrupt_disable)(struct pm8001_hba_info *pm8001_ha, u8 vec);
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index 536d2b4384f8..301de40eb708 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -4617,17 +4617,18 @@ static int pm80xx_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
> return pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
> }
>
> -static u32 pm80xx_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha)
> +static u32 pm80xx_chip_is_our_interrupt(struct pm8001_hba_info *pm8001_ha)
> {
> - u32 value;
> #ifdef PM8001_USE_MSIX
> return 1;
> -#endif
> +#else
> + u32 value;
> +
> value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
> if (value)
> return 1;
> return 0;
> -
> +#endif
> }
>
> /**
> @@ -4724,7 +4725,7 @@ const struct pm8001_dispatch pm8001_80xx_dispatch = {
> .chip_rst = pm80xx_hw_chip_rst,
> .chip_iounmap = pm8001_chip_iounmap,
> .isr = pm80xx_chip_isr,
> - .is_our_interupt = pm80xx_chip_is_our_interupt,
> + .is_our_interrupt = pm80xx_chip_is_our_interrupt,
> .isr_process_oq = process_oq,
> .interrupt_enable = pm80xx_chip_interrupt_enable,
> .interrupt_disable = pm80xx_chip_interrupt_disable,
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined (part2)
@ 2019-03-29 20:20 ` Mukesh Ojha
0 siblings, 0 replies; 14+ messages in thread
From: Mukesh Ojha @ 2019-03-29 20:20 UTC (permalink / raw)
To: Colin King, Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, linux-scsi
Cc: kernel-janitors, linux-kernel
On 3/29/2019 9:02 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> When macro PM8001_USE_MSIX is defined there is redundant dead code
> call to pm8001_cr32. Clean this up for the defined PM8001_USE_MSIX and
> undefined PM8001_USE_MSIX cases.
>
> Also rename the functions pm8001_chip_is_our_interupt,
> pm80xx_chip_is_our_interupt and function pointer is_our_interrupt
> to fix spelling mistakes.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
It would be better if you could split this into two patch, one for dead
code and other for renaming.
Otherwise change looks good.
Once you fix above you could include .
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Cheers,
-Mukesh
> ---
> drivers/scsi/pm8001/pm8001_hwi.c | 11 ++++++-----
> drivers/scsi/pm8001/pm8001_init.c | 4 ++--
> drivers/scsi/pm8001/pm8001_sas.h | 2 +-
> drivers/scsi/pm8001/pm80xx_hwi.c | 11 ++++++-----
> 4 files changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
> index e4209091c1da..627075d00918 100644
> --- a/drivers/scsi/pm8001/pm8001_hwi.c
> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
> @@ -4623,17 +4623,18 @@ static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
> return ret;
> }
>
> -static u32 pm8001_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha)
> +static u32 pm8001_chip_is_our_interrupt(struct pm8001_hba_info *pm8001_ha)
> {
> - u32 value;
> #ifdef PM8001_USE_MSIX
> return 1;
> -#endif
> +#else
> + u32 value;
> +
> value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
> if (value)
> return 1;
> return 0;
> -
> +#endif
> }
>
> /**
> @@ -5119,7 +5120,7 @@ const struct pm8001_dispatch pm8001_8001_dispatch = {
> .chip_rst = pm8001_hw_chip_rst,
> .chip_iounmap = pm8001_chip_iounmap,
> .isr = pm8001_chip_isr,
> - .is_our_interupt = pm8001_chip_is_our_interupt,
> + .is_our_interrupt = pm8001_chip_is_our_interrupt,
> .isr_process_oq = process_oq,
> .interrupt_enable = pm8001_chip_interrupt_enable,
> .interrupt_disable = pm8001_chip_interrupt_disable,
> diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
> index a36060c23b37..3374f553c617 100644
> --- a/drivers/scsi/pm8001/pm8001_init.c
> +++ b/drivers/scsi/pm8001/pm8001_init.c
> @@ -201,7 +201,7 @@ static irqreturn_t pm8001_interrupt_handler_msix(int irq, void *opaque)
>
> if (unlikely(!pm8001_ha))
> return IRQ_NONE;
> - if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha))
> + if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha))
> return IRQ_NONE;
> #ifdef PM8001_USE_TASKLET
> tasklet_schedule(&pm8001_ha->tasklet[irq_vector->irq_id]);
> @@ -224,7 +224,7 @@ static irqreturn_t pm8001_interrupt_handler_intx(int irq, void *dev_id)
> pm8001_ha = sha->lldd_ha;
> if (unlikely(!pm8001_ha))
> return IRQ_NONE;
> - if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha))
> + if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha))
> return IRQ_NONE;
>
> #ifdef PM8001_USE_TASKLET
> diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h
> index f88b0d33c385..ac6d8e3f22de 100644
> --- a/drivers/scsi/pm8001/pm8001_sas.h
> +++ b/drivers/scsi/pm8001/pm8001_sas.h
> @@ -197,7 +197,7 @@ struct pm8001_dispatch {
> int (*chip_ioremap)(struct pm8001_hba_info *pm8001_ha);
> void (*chip_iounmap)(struct pm8001_hba_info *pm8001_ha);
> irqreturn_t (*isr)(struct pm8001_hba_info *pm8001_ha, u8 vec);
> - u32 (*is_our_interupt)(struct pm8001_hba_info *pm8001_ha);
> + u32 (*is_our_interrupt)(struct pm8001_hba_info *pm8001_ha);
> int (*isr_process_oq)(struct pm8001_hba_info *pm8001_ha, u8 vec);
> void (*interrupt_enable)(struct pm8001_hba_info *pm8001_ha, u8 vec);
> void (*interrupt_disable)(struct pm8001_hba_info *pm8001_ha, u8 vec);
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index 536d2b4384f8..301de40eb708 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -4617,17 +4617,18 @@ static int pm80xx_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
> return pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
> }
>
> -static u32 pm80xx_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha)
> +static u32 pm80xx_chip_is_our_interrupt(struct pm8001_hba_info *pm8001_ha)
> {
> - u32 value;
> #ifdef PM8001_USE_MSIX
> return 1;
> -#endif
> +#else
> + u32 value;
> +
> value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
> if (value)
> return 1;
> return 0;
> -
> +#endif
> }
>
> /**
> @@ -4724,7 +4725,7 @@ const struct pm8001_dispatch pm8001_80xx_dispatch = {
> .chip_rst = pm80xx_hw_chip_rst,
> .chip_iounmap = pm8001_chip_iounmap,
> .isr = pm80xx_chip_isr,
> - .is_our_interupt = pm80xx_chip_is_our_interupt,
> + .is_our_interrupt = pm80xx_chip_is_our_interrupt,
> .isr_process_oq = process_oq,
> .interrupt_enable = pm80xx_chip_interrupt_enable,
> .interrupt_disable = pm80xx_chip_interrupt_disable,
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined (part2)
2019-03-29 20:20 ` Mukesh Ojha
@ 2019-03-29 21:12 ` Mukesh Ojha
-1 siblings, 0 replies; 14+ messages in thread
From: Mukesh Ojha @ 2019-03-29 21:00 UTC (permalink / raw)
To: Colin King, Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, linux-scsi
Cc: kernel-janitors, linux-kernel
On 3/30/2019 1:38 AM, Mukesh Ojha wrote:
>
> On 3/29/2019 9:02 PM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> When macro PM8001_USE_MSIX is defined there is redundant dead code
>> call to pm8001_cr32. Clean this up for the defined PM8001_USE_MSIX and
>> undefined PM8001_USE_MSIX cases.
>>
>> Also rename the functions pm8001_chip_is_our_interupt,
>> pm80xx_chip_is_our_interupt and function pointer is_our_interrupt
>> to fix spelling mistakes.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> It would be better if you could split this into two patch, one for
> dead code and other for renaming.
Also, What is that part2 in the subject ? please remove that too.
>
>
> Otherwise change looks good.
>
> Once you fix above you could include .
> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
>
> Cheers,
> -Mukesh
>
>
>> ---
>> drivers/scsi/pm8001/pm8001_hwi.c | 11 ++++++-----
>> drivers/scsi/pm8001/pm8001_init.c | 4 ++--
>> drivers/scsi/pm8001/pm8001_sas.h | 2 +-
>> drivers/scsi/pm8001/pm80xx_hwi.c | 11 ++++++-----
>> 4 files changed, 15 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c
>> b/drivers/scsi/pm8001/pm8001_hwi.c
>> index e4209091c1da..627075d00918 100644
>> --- a/drivers/scsi/pm8001/pm8001_hwi.c
>> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
>> @@ -4623,17 +4623,18 @@ static int pm8001_chip_phy_ctl_req(struct
>> pm8001_hba_info *pm8001_ha,
>> return ret;
>> }
>> -static u32 pm8001_chip_is_our_interupt(struct pm8001_hba_info
>> *pm8001_ha)
>> +static u32 pm8001_chip_is_our_interrupt(struct pm8001_hba_info
>> *pm8001_ha)
>> {
>> - u32 value;
>> #ifdef PM8001_USE_MSIX
>> return 1;
>> -#endif
>> +#else
>> + u32 value;
>> +
>> value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
>> if (value)
>> return 1;
>> return 0;
>> -
>> +#endif
>> }
>> /**
>> @@ -5119,7 +5120,7 @@ const struct pm8001_dispatch
>> pm8001_8001_dispatch = {
>> .chip_rst = pm8001_hw_chip_rst,
>> .chip_iounmap = pm8001_chip_iounmap,
>> .isr = pm8001_chip_isr,
>> - .is_our_interupt = pm8001_chip_is_our_interupt,
>> + .is_our_interrupt = pm8001_chip_is_our_interrupt,
>> .isr_process_oq = process_oq,
>> .interrupt_enable = pm8001_chip_interrupt_enable,
>> .interrupt_disable = pm8001_chip_interrupt_disable,
>> diff --git a/drivers/scsi/pm8001/pm8001_init.c
>> b/drivers/scsi/pm8001/pm8001_init.c
>> index a36060c23b37..3374f553c617 100644
>> --- a/drivers/scsi/pm8001/pm8001_init.c
>> +++ b/drivers/scsi/pm8001/pm8001_init.c
>> @@ -201,7 +201,7 @@ static irqreturn_t
>> pm8001_interrupt_handler_msix(int irq, void *opaque)
>> if (unlikely(!pm8001_ha))
>> return IRQ_NONE;
>> - if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha))
>> + if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha))
>> return IRQ_NONE;
>> #ifdef PM8001_USE_TASKLET
>> tasklet_schedule(&pm8001_ha->tasklet[irq_vector->irq_id]);
>> @@ -224,7 +224,7 @@ static irqreturn_t
>> pm8001_interrupt_handler_intx(int irq, void *dev_id)
>> pm8001_ha = sha->lldd_ha;
>> if (unlikely(!pm8001_ha))
>> return IRQ_NONE;
>> - if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha))
>> + if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha))
>> return IRQ_NONE;
>> #ifdef PM8001_USE_TASKLET
>> diff --git a/drivers/scsi/pm8001/pm8001_sas.h
>> b/drivers/scsi/pm8001/pm8001_sas.h
>> index f88b0d33c385..ac6d8e3f22de 100644
>> --- a/drivers/scsi/pm8001/pm8001_sas.h
>> +++ b/drivers/scsi/pm8001/pm8001_sas.h
>> @@ -197,7 +197,7 @@ struct pm8001_dispatch {
>> int (*chip_ioremap)(struct pm8001_hba_info *pm8001_ha);
>> void (*chip_iounmap)(struct pm8001_hba_info *pm8001_ha);
>> irqreturn_t (*isr)(struct pm8001_hba_info *pm8001_ha, u8 vec);
>> - u32 (*is_our_interupt)(struct pm8001_hba_info *pm8001_ha);
>> + u32 (*is_our_interrupt)(struct pm8001_hba_info *pm8001_ha);
>> int (*isr_process_oq)(struct pm8001_hba_info *pm8001_ha, u8 vec);
>> void (*interrupt_enable)(struct pm8001_hba_info *pm8001_ha, u8
>> vec);
>> void (*interrupt_disable)(struct pm8001_hba_info *pm8001_ha, u8
>> vec);
>> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c
>> b/drivers/scsi/pm8001/pm80xx_hwi.c
>> index 536d2b4384f8..301de40eb708 100644
>> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
>> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
>> @@ -4617,17 +4617,18 @@ static int pm80xx_chip_phy_ctl_req(struct
>> pm8001_hba_info *pm8001_ha,
>> return pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc,
>> &payload, 0);
>> }
>> -static u32 pm80xx_chip_is_our_interupt(struct pm8001_hba_info
>> *pm8001_ha)
>> +static u32 pm80xx_chip_is_our_interrupt(struct pm8001_hba_info
>> *pm8001_ha)
>> {
>> - u32 value;
>> #ifdef PM8001_USE_MSIX
>> return 1;
>> -#endif
>> +#else
>> + u32 value;
>> +
>> value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
>> if (value)
>> return 1;
>> return 0;
>> -
>> +#endif
>> }
>> /**
>> @@ -4724,7 +4725,7 @@ const struct pm8001_dispatch
>> pm8001_80xx_dispatch = {
>> .chip_rst = pm80xx_hw_chip_rst,
>> .chip_iounmap = pm8001_chip_iounmap,
>> .isr = pm80xx_chip_isr,
>> - .is_our_interupt = pm80xx_chip_is_our_interupt,
>> + .is_our_interrupt = pm80xx_chip_is_our_interrupt,
>> .isr_process_oq = process_oq,
>> .interrupt_enable = pm80xx_chip_interrupt_enable,
>> .interrupt_disable = pm80xx_chip_interrupt_disable,
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined (part2)
@ 2019-03-29 21:12 ` Mukesh Ojha
0 siblings, 0 replies; 14+ messages in thread
From: Mukesh Ojha @ 2019-03-29 21:12 UTC (permalink / raw)
To: Colin King, Jack Wang, lindar_liu, James E . J . Bottomley,
Martin K . Petersen, linux-scsi
Cc: kernel-janitors, linux-kernel
On 3/30/2019 1:38 AM, Mukesh Ojha wrote:
>
> On 3/29/2019 9:02 PM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> When macro PM8001_USE_MSIX is defined there is redundant dead code
>> call to pm8001_cr32. Clean this up for the defined PM8001_USE_MSIX and
>> undefined PM8001_USE_MSIX cases.
>>
>> Also rename the functions pm8001_chip_is_our_interupt,
>> pm80xx_chip_is_our_interupt and function pointer is_our_interrupt
>> to fix spelling mistakes.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> It would be better if you could split this into two patch, one for
> dead code and other for renaming.
Also, What is that part2 in the subject ? please remove that too.
>
>
> Otherwise change looks good.
>
> Once you fix above you could include .
> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
>
> Cheers,
> -Mukesh
>
>
>> ---
>> drivers/scsi/pm8001/pm8001_hwi.c | 11 ++++++-----
>> drivers/scsi/pm8001/pm8001_init.c | 4 ++--
>> drivers/scsi/pm8001/pm8001_sas.h | 2 +-
>> drivers/scsi/pm8001/pm80xx_hwi.c | 11 ++++++-----
>> 4 files changed, 15 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c
>> b/drivers/scsi/pm8001/pm8001_hwi.c
>> index e4209091c1da..627075d00918 100644
>> --- a/drivers/scsi/pm8001/pm8001_hwi.c
>> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
>> @@ -4623,17 +4623,18 @@ static int pm8001_chip_phy_ctl_req(struct
>> pm8001_hba_info *pm8001_ha,
>> return ret;
>> }
>> -static u32 pm8001_chip_is_our_interupt(struct pm8001_hba_info
>> *pm8001_ha)
>> +static u32 pm8001_chip_is_our_interrupt(struct pm8001_hba_info
>> *pm8001_ha)
>> {
>> - u32 value;
>> #ifdef PM8001_USE_MSIX
>> return 1;
>> -#endif
>> +#else
>> + u32 value;
>> +
>> value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
>> if (value)
>> return 1;
>> return 0;
>> -
>> +#endif
>> }
>> /**
>> @@ -5119,7 +5120,7 @@ const struct pm8001_dispatch
>> pm8001_8001_dispatch = {
>> .chip_rst = pm8001_hw_chip_rst,
>> .chip_iounmap = pm8001_chip_iounmap,
>> .isr = pm8001_chip_isr,
>> - .is_our_interupt = pm8001_chip_is_our_interupt,
>> + .is_our_interrupt = pm8001_chip_is_our_interrupt,
>> .isr_process_oq = process_oq,
>> .interrupt_enable = pm8001_chip_interrupt_enable,
>> .interrupt_disable = pm8001_chip_interrupt_disable,
>> diff --git a/drivers/scsi/pm8001/pm8001_init.c
>> b/drivers/scsi/pm8001/pm8001_init.c
>> index a36060c23b37..3374f553c617 100644
>> --- a/drivers/scsi/pm8001/pm8001_init.c
>> +++ b/drivers/scsi/pm8001/pm8001_init.c
>> @@ -201,7 +201,7 @@ static irqreturn_t
>> pm8001_interrupt_handler_msix(int irq, void *opaque)
>> if (unlikely(!pm8001_ha))
>> return IRQ_NONE;
>> - if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha))
>> + if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha))
>> return IRQ_NONE;
>> #ifdef PM8001_USE_TASKLET
>> tasklet_schedule(&pm8001_ha->tasklet[irq_vector->irq_id]);
>> @@ -224,7 +224,7 @@ static irqreturn_t
>> pm8001_interrupt_handler_intx(int irq, void *dev_id)
>> pm8001_ha = sha->lldd_ha;
>> if (unlikely(!pm8001_ha))
>> return IRQ_NONE;
>> - if (!PM8001_CHIP_DISP->is_our_interupt(pm8001_ha))
>> + if (!PM8001_CHIP_DISP->is_our_interrupt(pm8001_ha))
>> return IRQ_NONE;
>> #ifdef PM8001_USE_TASKLET
>> diff --git a/drivers/scsi/pm8001/pm8001_sas.h
>> b/drivers/scsi/pm8001/pm8001_sas.h
>> index f88b0d33c385..ac6d8e3f22de 100644
>> --- a/drivers/scsi/pm8001/pm8001_sas.h
>> +++ b/drivers/scsi/pm8001/pm8001_sas.h
>> @@ -197,7 +197,7 @@ struct pm8001_dispatch {
>> int (*chip_ioremap)(struct pm8001_hba_info *pm8001_ha);
>> void (*chip_iounmap)(struct pm8001_hba_info *pm8001_ha);
>> irqreturn_t (*isr)(struct pm8001_hba_info *pm8001_ha, u8 vec);
>> - u32 (*is_our_interupt)(struct pm8001_hba_info *pm8001_ha);
>> + u32 (*is_our_interrupt)(struct pm8001_hba_info *pm8001_ha);
>> int (*isr_process_oq)(struct pm8001_hba_info *pm8001_ha, u8 vec);
>> void (*interrupt_enable)(struct pm8001_hba_info *pm8001_ha, u8
>> vec);
>> void (*interrupt_disable)(struct pm8001_hba_info *pm8001_ha, u8
>> vec);
>> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c
>> b/drivers/scsi/pm8001/pm80xx_hwi.c
>> index 536d2b4384f8..301de40eb708 100644
>> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
>> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
>> @@ -4617,17 +4617,18 @@ static int pm80xx_chip_phy_ctl_req(struct
>> pm8001_hba_info *pm8001_ha,
>> return pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc,
>> &payload, 0);
>> }
>> -static u32 pm80xx_chip_is_our_interupt(struct pm8001_hba_info
>> *pm8001_ha)
>> +static u32 pm80xx_chip_is_our_interrupt(struct pm8001_hba_info
>> *pm8001_ha)
>> {
>> - u32 value;
>> #ifdef PM8001_USE_MSIX
>> return 1;
>> -#endif
>> +#else
>> + u32 value;
>> +
>> value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
>> if (value)
>> return 1;
>> return 0;
>> -
>> +#endif
>> }
>> /**
>> @@ -4724,7 +4725,7 @@ const struct pm8001_dispatch
>> pm8001_80xx_dispatch = {
>> .chip_rst = pm80xx_hw_chip_rst,
>> .chip_iounmap = pm8001_chip_iounmap,
>> .isr = pm80xx_chip_isr,
>> - .is_our_interupt = pm80xx_chip_is_our_interupt,
>> + .is_our_interrupt = pm80xx_chip_is_our_interrupt,
>> .isr_process_oq = process_oq,
>> .interrupt_enable = pm80xx_chip_interrupt_enable,
>> .interrupt_disable = pm80xx_chip_interrupt_disable,
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2019-03-29 21:12 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-28 23:43 [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined Colin King
2019-03-29 8:16 ` Jinpu Wang
2019-03-29 8:16 ` Jinpu Wang
2019-03-29 10:29 ` Mukesh Ojha
2019-03-29 10:41 ` Mukesh Ojha
2019-03-29 10:38 ` Colin Ian King
2019-03-29 14:14 ` Martin K. Petersen
2019-03-29 14:14 ` Martin K. Petersen
2019-03-29 15:32 [PATCH] scsi: pm8001: clean up structurally dead code when PM8001_USE_MSIX is defined (part2) Colin King
2019-03-29 15:32 ` Colin King
2019-03-29 20:08 ` Mukesh Ojha
2019-03-29 20:20 ` Mukesh Ojha
2019-03-29 21:00 ` Mukesh Ojha
2019-03-29 21:12 ` Mukesh Ojha
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.