All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] staging: rdma: hfi1: Drop wrapper functions
@ 2015-11-01 10:42 Amitoj Kaur Chawla
  2015-11-01 10:44 ` [PATCH v3 1/3] staging: rdma: hfi1: Remove hfi1_nomsix() wrapper function Amitoj Kaur Chawla
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Amitoj Kaur Chawla @ 2015-11-01 10:42 UTC (permalink / raw
  To: outreachy-kernel

This patchset removes wrapper functions to clean up code.

Changes in v2:
        -Removed two patches in the series
Changes in v3:
        -Improve commit message in second patch

Amitoj Kaur Chawla (3):
  staging: rdma: hfi1: Remove hfi1_nomsix() wrapper function
  staging: rdma: hfi1: sdma: Remove wrapper functions
  staging: rdma: hfi1: chip: Remove wrapper function

 drivers/staging/rdma/hfi1/chip.c | 10 ++--------
 drivers/staging/rdma/hfi1/hfi.h  |  1 -
 drivers/staging/rdma/hfi1/pcie.c |  8 --------
 drivers/staging/rdma/hfi1/sdma.c | 40 ++++++++++++++--------------------------
 4 files changed, 16 insertions(+), 43 deletions(-)

-- 
1.9.1



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

* [PATCH v3 1/3] staging: rdma: hfi1: Remove hfi1_nomsix() wrapper function
  2015-11-01 10:42 [PATCH v3 0/3] staging: rdma: hfi1: Drop wrapper functions Amitoj Kaur Chawla
@ 2015-11-01 10:44 ` Amitoj Kaur Chawla
  2015-11-01 10:46 ` [PATCH v3 2/3] staging: rdma: hfi1: sdma: Remove wrapper functions Amitoj Kaur Chawla
  2015-11-01 10:48 ` [PATCH v3 3/3] staging: rdma: hfi1: chip: Remove wrapper function Amitoj Kaur Chawla
  2 siblings, 0 replies; 4+ messages in thread
From: Amitoj Kaur Chawla @ 2015-11-01 10:44 UTC (permalink / raw
  To: outreachy-kernel

This patch removes hfi1_nomsix() wrapper function that is used to wrap
pci_disable_msix() and so substituted the wrapper function by a direct
call to pci_disable_msix().

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
Changes in v2:
        -Improved commit message
Changes in v3:
        -None

 drivers/staging/rdma/hfi1/chip.c | 2 +-
 drivers/staging/rdma/hfi1/hfi.h  | 1 -
 drivers/staging/rdma/hfi1/pcie.c | 8 --------
 3 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c
index aa58e59..beac326d 100644
--- a/drivers/staging/rdma/hfi1/chip.c
+++ b/drivers/staging/rdma/hfi1/chip.c
@@ -8694,7 +8694,7 @@ static void clean_up_interrupts(struct hfi1_devdata *dd)
 	/* turn off interrupts */
 	if (dd->num_msix_entries) {
 		/* MSI-X */
-		hfi1_nomsix(dd);
+		pci_disable_msix(dd->pcidev);
 	} else {
 		/* INTx */
 		disable_intx(dd->pcidev);
diff --git a/drivers/staging/rdma/hfi1/hfi.h b/drivers/staging/rdma/hfi1/hfi.h
index 8ca171b..1f97124 100644
--- a/drivers/staging/rdma/hfi1/hfi.h
+++ b/drivers/staging/rdma/hfi1/hfi.h
@@ -1600,7 +1600,6 @@ void hfi1_pcie_flr(struct hfi1_devdata *);
 int pcie_speeds(struct hfi1_devdata *);
 void request_msix(struct hfi1_devdata *, u32 *, struct hfi1_msix_entry *);
 void hfi1_enable_intx(struct pci_dev *);
-void hfi1_nomsix(struct hfi1_devdata *);
 void restore_pci_variables(struct hfi1_devdata *dd);
 int do_pcie_gen3_transition(struct hfi1_devdata *dd);
 int parse_platform_config(struct hfi1_devdata *dd);
diff --git a/drivers/staging/rdma/hfi1/pcie.c b/drivers/staging/rdma/hfi1/pcie.c
index ac5653c..e6773b3 100644
--- a/drivers/staging/rdma/hfi1/pcie.c
+++ b/drivers/staging/rdma/hfi1/pcie.c
@@ -426,14 +426,6 @@ void request_msix(struct hfi1_devdata *dd, u32 *nent,
 	tune_pcie_caps(dd);
 }
 
-/*
- * Disable MSI-X.
- */
-void hfi1_nomsix(struct hfi1_devdata *dd)
-{
-	pci_disable_msix(dd->pcidev);
-}
-
 void hfi1_enable_intx(struct pci_dev *pdev)
 {
 	/* first, turn on INTx */
-- 
1.9.1



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

* [PATCH v3 2/3] staging: rdma: hfi1: sdma: Remove wrapper functions
  2015-11-01 10:42 [PATCH v3 0/3] staging: rdma: hfi1: Drop wrapper functions Amitoj Kaur Chawla
  2015-11-01 10:44 ` [PATCH v3 1/3] staging: rdma: hfi1: Remove hfi1_nomsix() wrapper function Amitoj Kaur Chawla
@ 2015-11-01 10:46 ` Amitoj Kaur Chawla
  2015-11-01 10:48 ` [PATCH v3 3/3] staging: rdma: hfi1: chip: Remove wrapper function Amitoj Kaur Chawla
  2 siblings, 0 replies; 4+ messages in thread
From: Amitoj Kaur Chawla @ 2015-11-01 10:46 UTC (permalink / raw
  To: outreachy-kernel

Drop wrapper functions sdma_start_err_halt_wait() and
sdma_start_sw_clean_up() that can be replaced by a direct call to
schedule_work() and tasklet_hi_schedule() respectively both of which
are standard kernel functions.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
Changes in v2:
        -Improved commit message
Changes in v3:
        -Improved commit message

 drivers/staging/rdma/hfi1/sdma.c | 40 ++++++++++++++--------------------------
 1 file changed, 14 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/rdma/hfi1/sdma.c b/drivers/staging/rdma/hfi1/sdma.c
index 63ab721..4e44ac7 100644
--- a/drivers/staging/rdma/hfi1/sdma.c
+++ b/drivers/staging/rdma/hfi1/sdma.c
@@ -230,7 +230,6 @@ static void sdma_hw_clean_up_task(unsigned long);
 static void sdma_put(struct sdma_state *);
 static void sdma_set_state(struct sdma_engine *, enum sdma_states);
 static void sdma_start_hw_clean_up(struct sdma_engine *);
-static void sdma_start_sw_clean_up(struct sdma_engine *);
 static void sdma_sw_clean_up_task(unsigned long);
 static void sdma_sendctrl(struct sdma_engine *, unsigned);
 static void init_sdma_regs(struct sdma_engine *, u32, uint);
@@ -454,12 +453,6 @@ static void sdma_err_halt_wait(struct work_struct *work)
 	sdma_process_event(sde, sdma_event_e15_hw_halt_done);
 }
 
-static void sdma_start_err_halt_wait(struct sdma_engine *sde)
-{
-	schedule_work(&sde->err_halt_worker);
-}
-
-
 static void sdma_err_progress_check_schedule(struct sdma_engine *sde)
 {
 	if (!is_bx(sde->dd) && HFI1_CAP_IS_KSET(SDMA_AHG)) {
@@ -666,11 +659,6 @@ static void sdma_start_hw_clean_up(struct sdma_engine *sde)
 	tasklet_hi_schedule(&sde->sdma_hw_clean_up_task);
 }
 
-static void sdma_start_sw_clean_up(struct sdma_engine *sde)
-{
-	tasklet_hi_schedule(&sde->sdma_sw_clean_up_task);
-}
-
 static void sdma_set_state(struct sdma_engine *sde,
 	enum sdma_states next_state)
 {
@@ -2291,7 +2279,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
 		case sdma_event_e50_hw_cleaned:
 			break;
 		case sdma_event_e60_hw_halted:
-			sdma_start_err_halt_wait(sde);
+			schedule_work(&sde->err_halt_worker);
 			break;
 		case sdma_event_e70_go_idle:
 			ss->go_s99_running = 0;
@@ -2372,7 +2360,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
 			break;
 		case sdma_event_e60_hw_halted:
 			sdma_set_state(sde, sdma_state_s50_hw_halt_wait);
-			sdma_start_err_halt_wait(sde);
+			schedule_work(&sde->err_halt_worker);
 			break;
 		case sdma_event_e70_go_idle:
 			break;
@@ -2435,7 +2423,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
 		switch (event) {
 		case sdma_event_e00_go_hw_down:
 			sdma_set_state(sde, sdma_state_s00_hw_down);
-			sdma_start_sw_clean_up(sde);
+			tasklet_hi_schedule(&sde->sdma_sw_clean_up_task);
 			break;
 		case sdma_event_e10_go_hw_start:
 			break;
@@ -2477,13 +2465,13 @@ static void __sdma_process_event(struct sdma_engine *sde,
 		switch (event) {
 		case sdma_event_e00_go_hw_down:
 			sdma_set_state(sde, sdma_state_s00_hw_down);
-			sdma_start_sw_clean_up(sde);
+			tasklet_hi_schedule(&sde->sdma_sw_clean_up_task);
 			break;
 		case sdma_event_e10_go_hw_start:
 			break;
 		case sdma_event_e15_hw_halt_done:
 			sdma_set_state(sde, sdma_state_s30_sw_clean_up_wait);
-			sdma_start_sw_clean_up(sde);
+			tasklet_hi_schedule(&sde->sdma_sw_clean_up_task);
 			break;
 		case sdma_event_e25_hw_clean_up_done:
 			break;
@@ -2495,7 +2483,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
 		case sdma_event_e50_hw_cleaned:
 			break;
 		case sdma_event_e60_hw_halted:
-			sdma_start_err_halt_wait(sde);
+			schedule_work(&sde->err_halt_worker);
 			break;
 		case sdma_event_e70_go_idle:
 			ss->go_s99_running = 0;
@@ -2518,13 +2506,13 @@ static void __sdma_process_event(struct sdma_engine *sde,
 		switch (event) {
 		case sdma_event_e00_go_hw_down:
 			sdma_set_state(sde, sdma_state_s00_hw_down);
-			sdma_start_sw_clean_up(sde);
+			tasklet_hi_schedule(&sde->sdma_sw_clean_up_task);
 			break;
 		case sdma_event_e10_go_hw_start:
 			break;
 		case sdma_event_e15_hw_halt_done:
 			sdma_set_state(sde, sdma_state_s30_sw_clean_up_wait);
-			sdma_start_sw_clean_up(sde);
+			tasklet_hi_schedule(&sde->sdma_sw_clean_up_task);
 			break;
 		case sdma_event_e25_hw_clean_up_done:
 			break;
@@ -2536,7 +2524,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
 		case sdma_event_e50_hw_cleaned:
 			break;
 		case sdma_event_e60_hw_halted:
-			sdma_start_err_halt_wait(sde);
+			schedule_work(&sde->err_halt_worker);
 			break;
 		case sdma_event_e70_go_idle:
 			ss->go_s99_running = 0;
@@ -2558,7 +2546,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
 		switch (event) {
 		case sdma_event_e00_go_hw_down:
 			sdma_set_state(sde, sdma_state_s00_hw_down);
-			sdma_start_sw_clean_up(sde);
+			tasklet_hi_schedule(&sde->sdma_sw_clean_up_task);
 			break;
 		case sdma_event_e10_go_hw_start:
 			break;
@@ -2582,7 +2570,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
 			break;
 		case sdma_event_e81_hw_frozen:
 			sdma_set_state(sde, sdma_state_s82_freeze_sw_clean);
-			sdma_start_sw_clean_up(sde);
+			tasklet_hi_schedule(&sde->sdma_sw_clean_up_task);
 			break;
 		case sdma_event_e82_hw_unfreeze:
 			break;
@@ -2597,7 +2585,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
 		switch (event) {
 		case sdma_event_e00_go_hw_down:
 			sdma_set_state(sde, sdma_state_s00_hw_down);
-			sdma_start_sw_clean_up(sde);
+			tasklet_hi_schedule(&sde->sdma_sw_clean_up_task);
 			break;
 		case sdma_event_e10_go_hw_start:
 			break;
@@ -2641,7 +2629,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
 		switch (event) {
 		case sdma_event_e00_go_hw_down:
 			sdma_set_state(sde, sdma_state_s00_hw_down);
-			sdma_start_sw_clean_up(sde);
+			tasklet_hi_schedule(&sde->sdma_sw_clean_up_task);
 			break;
 		case sdma_event_e10_go_hw_start:
 			break;
@@ -2664,7 +2652,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
 			* progress check
 			*/
 			sdma_set_state(sde, sdma_state_s50_hw_halt_wait);
-			sdma_start_err_halt_wait(sde);
+			schedule_work(&sde->err_halt_worker);
 			break;
 		case sdma_event_e70_go_idle:
 			sdma_set_state(sde, sdma_state_s60_idle_halt_wait);
-- 
1.9.1



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

* [PATCH v3 3/3] staging: rdma: hfi1: chip: Remove wrapper function
  2015-11-01 10:42 [PATCH v3 0/3] staging: rdma: hfi1: Drop wrapper functions Amitoj Kaur Chawla
  2015-11-01 10:44 ` [PATCH v3 1/3] staging: rdma: hfi1: Remove hfi1_nomsix() wrapper function Amitoj Kaur Chawla
  2015-11-01 10:46 ` [PATCH v3 2/3] staging: rdma: hfi1: sdma: Remove wrapper functions Amitoj Kaur Chawla
@ 2015-11-01 10:48 ` Amitoj Kaur Chawla
  2 siblings, 0 replies; 4+ messages in thread
From: Amitoj Kaur Chawla @ 2015-11-01 10:48 UTC (permalink / raw
  To: outreachy-kernel

Drop wrapper function remap_receive_available_interrupt() that wraps a
call to remap_intr() with the only difference being the addition of
macro IS_RCVAVAIL_START to the second argument of remap_intr().

Both the function names give the same information so the wrapper
function can be dropped.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
Changes in v2:
        -Improved commit message
Changes in v3:
        -None

 drivers/staging/rdma/hfi1/chip.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c
index beac326d..a9c6abf 100644
--- a/drivers/staging/rdma/hfi1/chip.c
+++ b/drivers/staging/rdma/hfi1/chip.c
@@ -8749,12 +8749,6 @@ static void remap_sdma_interrupts(struct hfi1_devdata *dd,
 		msix_intr);
 }
 
-static void remap_receive_available_interrupt(struct hfi1_devdata *dd,
-					      int rx, int msix_intr)
-{
-	remap_intr(dd, IS_RCVAVAIL_START + rx, msix_intr);
-}
-
 static int request_intx_irq(struct hfi1_devdata *dd)
 {
 	int ret;
@@ -8890,7 +8884,7 @@ static int request_msix_irqs(struct hfi1_devdata *dd)
 			snprintf(me->name, sizeof(me->name),
 				DRIVER_NAME"_%d kctxt%d", dd->unit, idx);
 			err_info = "receive context";
-			remap_receive_available_interrupt(dd, idx, i);
+			remap_intr(dd, IS_RCVAVAIL_START + idx, i);
 		} else {
 			/* not in our expected range - complain, then
 			   ignore it */
-- 
1.9.1



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

end of thread, other threads:[~2015-11-01 10:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-01 10:42 [PATCH v3 0/3] staging: rdma: hfi1: Drop wrapper functions Amitoj Kaur Chawla
2015-11-01 10:44 ` [PATCH v3 1/3] staging: rdma: hfi1: Remove hfi1_nomsix() wrapper function Amitoj Kaur Chawla
2015-11-01 10:46 ` [PATCH v3 2/3] staging: rdma: hfi1: sdma: Remove wrapper functions Amitoj Kaur Chawla
2015-11-01 10:48 ` [PATCH v3 3/3] staging: rdma: hfi1: chip: Remove wrapper function Amitoj Kaur Chawla

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.