Skip to contentSkip to conversation

Staging: qlge: Rename of function prefix ql_ to qlge_

PATCH In review Samuil Ivanov 3 participants 8 messages Oct 24, 2019 – Oct 25, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Staging: qlge: Rename of function prefix ql_ to qlge_

In terms of namespace, the driver uses either qlge_, ql_ (used by other qlogic drivers, with clashes, ex: ql_sem_spinlock) or nothing (with clashes, ex: struct ob_mac_iocb_req). Rename everything to use the "qlge_" prefix.

So I renamed three functions to the prefered namespace "qlge", and updated the occurrences in the driver.

Samuil Ivanov (3):
Staging: qlge: Rename prefix of a function to qlge
Staging: qlge: Rename prefix of a function to qlge
Staging: qlge: Rename prefix of a function to qlge

 drivers/staging/qlge/qlge.h      |  6 +++---
 drivers/staging/qlge/qlge_dbg.c  |  4 ++--
 drivers/staging/qlge/qlge_main.c |  2 +-
 drivers/staging/qlge/qlge_mpi.c  | 12 ++++++------
 4 files changed, 12 insertions(+), 12 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/3 Staging: qlge: Rename prefix of a function to qlge

This is from the TODO list:
In terms of namespace, the driver uses either qlge_, ql_ (used by other qlogic drivers, with clashes, ex: ql_sem_spinlock) or nothing (with clashes, ex: struct ob_mac_iocb_req). Rename everything to use the "qlge_" prefix

Function ql_soft_reset_mpi_risc renamed to qlge_soft_reset_mpi_risc and it's clients updated.

---
 drivers/staging/qlge/qlge.h     | 2 +-
 drivers/staging/qlge/qlge_dbg.c | 2 +-
 drivers/staging/qlge/qlge_mpi.c | 5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)
drivers/staging/qlge/qlge.h +1 -1
index 6ec7e3ce3863..e9f1363c5bf2 100644
@@ -2262,7 +2262,7 @@ int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data);
 int ql_unpause_mpi_risc(struct ql_adapter *qdev);
 int ql_pause_mpi_risc(struct ql_adapter *qdev);
 int ql_hard_reset_mpi_risc(struct ql_adapter *qdev);
-int ql_soft_reset_mpi_risc(struct ql_adapter *qdev);
+int qlge_soft_reset_mpi_risc(struct ql_adapter *qdev);
 int ql_dump_risc_ram_area(struct ql_adapter *qdev, void *buf, u32 ram_addr,
 			  int word_count);
 int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump);
drivers/staging/qlge/qlge_dbg.c +1 -1
index 019b7e6a1b7a..df5344e113ca 100644
@@ -1312,7 +1312,7 @@ void ql_get_dump(struct ql_adapter *qdev, void *buff)
 
 	if (!test_bit(QL_FRC_COREDUMP, &qdev->flags)) {
 		if (!ql_core_dump(qdev, buff))
-			ql_soft_reset_mpi_risc(qdev);
+			qlge_soft_reset_mpi_risc(qdev);
 		else
 			netif_err(qdev, drv, qdev->ndev, "coredump failed!\n");
 	} else {
drivers/staging/qlge/qlge_mpi.c +3 -2
index 9e422bbbb6ab..efe893935929 100644
@@ -88,9 +88,10 @@ int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data)
 	return status;
 }
 
-int ql_soft_reset_mpi_risc(struct ql_adapter *qdev)
+int qlge_soft_reset_mpi_risc(struct ql_adapter *qdev)
 {
 	int status;
+
 	status = ql_write_mpi_reg(qdev, 0x00001010, 1);
 	return status;
 }
@@ -1280,5 +1281,5 @@ void ql_mpi_reset_work(struct work_struct *work)
 		queue_delayed_work(qdev->workqueue,
 			&qdev->mpi_core_to_log, 5 * HZ);
 	}
-	ql_soft_reset_mpi_risc(qdev);
+	qlge_soft_reset_mpi_risc(qdev);
 }
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH 1/3] Staging: qlge: Rename prefix of a function to qlge

drivers/staging/qlge/qlge.h int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data); · line 2265

Quoted 10 lines · Samuil Ivanov
drivers/staging/qlge/qlge.h +1 -1
index 6ec7e3ce3863..e9f1363c5bf2 100644
@@ -2262,7 +2262,7 @@ int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data);
 int ql_unpause_mpi_risc(struct ql_adapter *qdev);
 int ql_pause_mpi_risc(struct ql_adapter *qdev);
 int ql_hard_reset_mpi_risc(struct ql_adapter *qdev);
-int ql_soft_reset_mpi_risc(struct ql_adapter *qdev);
+int qlge_soft_reset_mpi_risc(struct ql_adapter *qdev);

The patch series doesn't change all the functions so now it's hodge podge.

Quoted 21 lines
drivers/staging/qlge/qlge.h +0 -0
 int ql_dump_risc_ram_area(struct ql_adapter *qdev, void *buf, u32 ram_addr,
 			  int word_count);
 int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump);
drivers/staging/qlge/qlge_dbg.c +1 -1
index 019b7e6a1b7a..df5344e113ca 100644
@@ -1312,7 +1312,7 @@ void ql_get_dump(struct ql_adapter *qdev, void *buff)
 
 	if (!test_bit(QL_FRC_COREDUMP, &qdev->flags)) {
 		if (!ql_core_dump(qdev, buff))
-			ql_soft_reset_mpi_risc(qdev);
+			qlge_soft_reset_mpi_risc(qdev);
 		else
 			netif_err(qdev, drv, qdev->ndev, "coredump failed!\n");
 	} else {
drivers/staging/qlge/qlge_mpi.c +0 -0
index 9e422bbbb6ab..efe893935929 100644

drivers/staging/qlge/qlge_mpi.c int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data) · line 95

Quoted 9 lines
drivers/staging/qlge/qlge_mpi.c +2 -1
@@ -88,9 +88,10 @@ int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data)
 	return status;
 }
 
-int ql_soft_reset_mpi_risc(struct ql_adapter *qdev)
+int qlge_soft_reset_mpi_risc(struct ql_adapter *qdev)
 {
 	int status;
+
 	status = ql_write_mpi_reg(qdev, 0x00001010, 1);

This white space change is unrelated.

drivers/staging/qlge/qlge_mpi.c int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data) · line 97

Quoted 2 lines
drivers/staging/qlge/qlge_mpi.c +0 -0
 	return status;
 }

regards,
dan carpenter

#3 lore raw

Re: [PATCH 1/3] Staging: qlge: Rename prefix of a function to qlge

Quoted 48 lines · Dan Carpenter

drivers/staging/qlge/qlge.h int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data); · line 2265

Quoted 10 lines · Samuil Ivanov
drivers/staging/qlge/qlge.h +1 -1
index 6ec7e3ce3863..e9f1363c5bf2 100644
@@ -2262,7 +2262,7 @@ int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data);
 int ql_unpause_mpi_risc(struct ql_adapter *qdev);
 int ql_pause_mpi_risc(struct ql_adapter *qdev);
 int ql_hard_reset_mpi_risc(struct ql_adapter *qdev);
-int ql_soft_reset_mpi_risc(struct ql_adapter *qdev);
+int qlge_soft_reset_mpi_risc(struct ql_adapter *qdev);

The patch series doesn't change all the functions so now it's hodge podge.

Quoted 21 lines
drivers/staging/qlge/qlge.h +0 -0
 int ql_dump_risc_ram_area(struct ql_adapter *qdev, void *buf, u32 ram_addr,
 			  int word_count);
 int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump);
drivers/staging/qlge/qlge_dbg.c +1 -1
index 019b7e6a1b7a..df5344e113ca 100644
@@ -1312,7 +1312,7 @@ void ql_get_dump(struct ql_adapter *qdev, void *buff)
 
 	if (!test_bit(QL_FRC_COREDUMP, &qdev->flags)) {
 		if (!ql_core_dump(qdev, buff))
-			ql_soft_reset_mpi_risc(qdev);
+			qlge_soft_reset_mpi_risc(qdev);
 		else
 			netif_err(qdev, drv, qdev->ndev, "coredump failed!\n");
 	} else {
drivers/staging/qlge/qlge_mpi.c +0 -0
index 9e422bbbb6ab..efe893935929 100644

drivers/staging/qlge/qlge_mpi.c int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data) · line 95

Quoted 9 lines
drivers/staging/qlge/qlge_mpi.c +2 -1
@@ -88,9 +88,10 @@ int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data)
 	return status;
 }
 
-int ql_soft_reset_mpi_risc(struct ql_adapter *qdev)
+int qlge_soft_reset_mpi_risc(struct ql_adapter *qdev)
 {
 	int status;
+
 	status = ql_write_mpi_reg(qdev, 0x00001010, 1);

This white space change is unrelated.

Quoted 6 lines

drivers/staging/qlge/qlge_mpi.c int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data) · line 97

Quoted 2 lines
drivers/staging/qlge/qlge_mpi.c +0 -0
 	return status;
 }

regards,
dan carpenter

Hello Dan and Greg,

Dan you are correct it is a bit of a hodge podge :)
I think that it is better to have a bigger patches that will rename more functions, but I don't this it is good to have all the functions renamed in one patch.

Just in the header file I counted around 55 function definitions, and in the source files there are some more.
So that will make one huge patch.

And I am not sure if the maintainers will be OK with reviewing it.

So my sugestion is to have a bigger patches.
For example, one patch with 10 to 15 subpatches.
And one subpatch will rename one function and
update the occurrences in the driver.

This way with like 5 iterations all the functions will be renamed.

If you have a better solution please tell.

Grt,
Samuil

#4 lore raw

Re: [PATCH 1/3] Staging: qlge: Rename prefix of a function to qlge

Quoted 9 lines · Samuil Ivanov

Dan you are correct it is a bit of a hodge podge :)
I think that it is better to have a bigger patches that will rename more functions, but I don't this it is good to have all the functions renamed in one patch.

Just in the header file I counted around 55 function definitions, and in the source files there are some more.
So that will make one huge patch.

I don't really have a problem if you rename everything at once. Or if you want to rename all of them in a 55 patch patchset that's also fine with me...

regards,
dan carpenter

#5 lore raw

PATCH 2/3 Staging: qlge: Rename prefix of a function to qlge

In reply to Samuil Ivanov

Function ql_own_firmware renamed to
qlge_own_firmware and it's clients updated.

---
 drivers/staging/qlge/qlge.h     | 2 +-
 drivers/staging/qlge/qlge_dbg.c | 2 +-
 drivers/staging/qlge/qlge_mpi.c | 5 ++---
 3 files changed, 4 insertions(+), 5 deletions(-)
drivers/staging/qlge/qlge.h +1 -1
index e9f1363c5bf2..d3f10c95c781 100644
@@ -2280,7 +2280,7 @@ int ql_wait_fifo_empty(struct ql_adapter *qdev);
 void ql_get_dump(struct ql_adapter *qdev, void *buff);
 netdev_tx_t ql_lb_send(struct sk_buff *skb, struct net_device *ndev);
 void ql_check_lb_frame(struct ql_adapter *, struct sk_buff *);
-int ql_own_firmware(struct ql_adapter *qdev);
+int qlge_own_firmware(struct ql_adapter *qdev);
 int ql_clean_lb_rx_ring(struct rx_ring *rx_ring, int budget);
 
 /* #define QL_ALL_DUMP */
drivers/staging/qlge/qlge_dbg.c +1 -1
index df5344e113ca..82bca35543d3 100644
@@ -1209,7 +1209,7 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
 
 static void ql_get_core_dump(struct ql_adapter *qdev)
 {
-	if (!ql_own_firmware(qdev)) {
+	if (!qlge_own_firmware(qdev)) {
 		netif_err(qdev, drv, qdev->ndev, "Don't own firmware!\n");
 		return;
 	}
drivers/staging/qlge/qlge_mpi.c +2 -3
index efe893935929..ccffe0b256fa 100644
@@ -101,7 +101,7 @@ int qlge_soft_reset_mpi_risc(struct ql_adapter *qdev)
  * we are the higher function and the lower function
  * is not enabled.
  */
-int ql_own_firmware(struct ql_adapter *qdev)
+int qlge_own_firmware(struct ql_adapter *qdev)
 {
 	u32 temp;
 
@@ -122,7 +122,6 @@ int ql_own_firmware(struct ql_adapter *qdev)
 		return 1;
 
 	return 0;
-
 }
 
 static int ql_get_mb_sts(struct ql_adapter *qdev, struct mbox_params *mbcp)
@@ -1270,7 +1269,7 @@ void ql_mpi_reset_work(struct work_struct *work)
 	/* If we're not the dominant NIC function,
 	 * then there is nothing to do.
 	 */
-	if (!ql_own_firmware(qdev)) {
+	if (!qlge_own_firmware(qdev)) {
 		netif_err(qdev, drv, qdev->ndev, "Don't own firmware!\n");
 		return;
 	}
Signature · 1 line
2.17.1
#6 lore raw

PATCH 3/3 Staging: qlge: Rename prefix of a function to qlge

In reply to Samuil Ivanov

Function ql_mb_about_fw renamed to
qlge_mb_about_fw and it's clients updated.

---
 drivers/staging/qlge/qlge.h      | 2 +-
 drivers/staging/qlge/qlge_main.c | 2 +-
 drivers/staging/qlge/qlge_mpi.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/qlge/qlge.h +1 -1
index d3f10c95c781..649f1fd10739 100644
@@ -2266,7 +2266,7 @@ int qlge_soft_reset_mpi_risc(struct ql_adapter *qdev);
 int ql_dump_risc_ram_area(struct ql_adapter *qdev, void *buf, u32 ram_addr,
 			  int word_count);
 int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump);
-int ql_mb_about_fw(struct ql_adapter *qdev);
+int qlge_mb_about_fw(struct ql_adapter *qdev);
 int ql_mb_wol_set_magic(struct ql_adapter *qdev, u32 enable_wol);
 int ql_mb_wol_mode(struct ql_adapter *qdev, u32 wol);
 int ql_mb_set_led_cfg(struct ql_adapter *qdev, u32 led_config);
drivers/staging/qlge/qlge_main.c +1 -1
index 0c381d91faa6..b8f4f4e5e579 100644
@@ -880,7 +880,7 @@ static int ql_8000_port_initialize(struct ql_adapter *qdev)
 	 * Get MPI firmware version for driver banner
 	 * and ethool info.
 	 */
-	status = ql_mb_about_fw(qdev);
+	status = qlge_mb_about_fw(qdev);
 	if (status)
 		goto exit;
 	status = ql_mb_get_fw_state(qdev);
drivers/staging/qlge/qlge_mpi.c +1 -1
index ccffe0b256fa..092695719c58 100644
@@ -612,7 +612,7 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp)
  * driver banner and for ethtool info.
  * Returns zero on success.
  */
-int ql_mb_about_fw(struct ql_adapter *qdev)
+int qlge_mb_about_fw(struct ql_adapter *qdev)
 {
 	struct mbox_params mbc;
 	struct mbox_params *mbcp = &mbc;
Signature · 1 line
2.17.1
maintainer
#7 lore raw
In reply to Samuil Ivanov
Quoted 5 lines · Samuil Ivanov

In terms of namespace, the driver uses either qlge_, ql_ (used by other qlogic drivers, with clashes, ex: ql_sem_spinlock) or nothing (with clashes, ex: struct ob_mac_iocb_req). Rename everything to use the "qlge_" prefix.

Quoted 7 lines

So I renamed three functions to the prefered namespace "qlge", and updated the occurrences in the driver.

Samuil Ivanov (3):
Staging: qlge: Rename prefix of a function to qlge
Staging: qlge: Rename prefix of a function to qlge
Staging: qlge: Rename prefix of a function to qlge

You sent 3 patches that do different things, yet have the same identical subject line :(

Please fix up and resend the series.

thanks,

greg k-h