All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: qlge: unify multi-line string
@ 2020-02-21 18:50 ` Kaaira Gupta
  0 siblings, 0 replies; 4+ messages in thread
From: Kaaira Gupta @ 2020-02-21 18:50 UTC (permalink / raw)
  To: Manish Chopra, GR-Linux-NIC-Dev, Greg Kroah-Hartman, netdev,
	devel, linux-kernel

Fix checkpatch.pl warning of 'quoted string split across lines' in
qlge_dbg.c by merging the strings in one line. Fixing this warning is
necessary to ease grep-ing the source for printk.

Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
---
 drivers/staging/qlge/qlge_dbg.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
index 8cf39615c520..28d8649ab384 100644
--- a/drivers/staging/qlge/qlge_dbg.c
+++ b/drivers/staging/qlge/qlge_dbg.c
@@ -1333,16 +1333,16 @@ void ql_mpi_core_to_log(struct work_struct *work)
 		     "Core is dumping to log file!\n");
 
 	for (i = 0; i < count; i += 8) {
-		pr_err("%.08x: %.08x %.08x %.08x %.08x %.08x "
-			"%.08x %.08x %.08x\n", i,
-			tmp[i + 0],
-			tmp[i + 1],
-			tmp[i + 2],
-			tmp[i + 3],
-			tmp[i + 4],
-			tmp[i + 5],
-			tmp[i + 6],
-			tmp[i + 7]);
+		pr_err("%.08x: %.08x %.08x %.08x %.08x %.08x %.08x %.08x %.08x\n",
+		       i,
+		       tmp[i + 0],
+		       tmp[i + 1],
+		       tmp[i + 2],
+		       tmp[i + 3],
+		       tmp[i + 4],
+		       tmp[i + 5],
+		       tmp[i + 6],
+		       tmp[i + 7]);
 		msleep(5);
 	}
 }
-- 
2.17.1


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

* [PATCH] staging: qlge: unify multi-line string
@ 2020-02-21 18:50 ` Kaaira Gupta
  0 siblings, 0 replies; 4+ messages in thread
From: Kaaira Gupta @ 2020-02-21 18:50 UTC (permalink / raw)
  To: Manish Chopra, GR-Linux-NIC-Dev, Greg Kroah-Hartman, netdev,
	devel, linux-kernel

Fix checkpatch.pl warning of 'quoted string split across lines' in
qlge_dbg.c by merging the strings in one line. Fixing this warning is
necessary to ease grep-ing the source for printk.

Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
---
 drivers/staging/qlge/qlge_dbg.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
index 8cf39615c520..28d8649ab384 100644
--- a/drivers/staging/qlge/qlge_dbg.c
+++ b/drivers/staging/qlge/qlge_dbg.c
@@ -1333,16 +1333,16 @@ void ql_mpi_core_to_log(struct work_struct *work)
 		     "Core is dumping to log file!\n");
 
 	for (i = 0; i < count; i += 8) {
-		pr_err("%.08x: %.08x %.08x %.08x %.08x %.08x "
-			"%.08x %.08x %.08x\n", i,
-			tmp[i + 0],
-			tmp[i + 1],
-			tmp[i + 2],
-			tmp[i + 3],
-			tmp[i + 4],
-			tmp[i + 5],
-			tmp[i + 6],
-			tmp[i + 7]);
+		pr_err("%.08x: %.08x %.08x %.08x %.08x %.08x %.08x %.08x %.08x\n",
+		       i,
+		       tmp[i + 0],
+		       tmp[i + 1],
+		       tmp[i + 2],
+		       tmp[i + 3],
+		       tmp[i + 4],
+		       tmp[i + 5],
+		       tmp[i + 6],
+		       tmp[i + 7]);
 		msleep(5);
 	}
 }
-- 
2.17.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH] staging: qlge: unify multi-line string
  2020-02-21 18:50 ` Kaaira Gupta
@ 2020-02-22  0:34   ` Joe Perches
  -1 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2020-02-22  0:34 UTC (permalink / raw)
  To: Kaaira Gupta, Manish Chopra, GR-Linux-NIC-Dev,
	Greg Kroah-Hartman, netdev, devel, linux-kernel

On Sat, 2020-02-22 at 00:20 +0530, Kaaira Gupta wrote:
> Fix checkpatch.pl warning of 'quoted string split across lines' in
> qlge_dbg.c by merging the strings in one line. Fixing this warning is
> necessary to ease grep-ing the source for printk.
[]
> diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
[]
> @@ -1333,16 +1333,16 @@ void ql_mpi_core_to_log(struct work_struct *work)
>  		     "Core is dumping to log file!\n");
>  
>  	for (i = 0; i < count; i += 8) {
> -		pr_err("%.08x: %.08x %.08x %.08x %.08x %.08x "
> -			"%.08x %.08x %.08x\n", i,
> -			tmp[i + 0],
> -			tmp[i + 1],
> -			tmp[i + 2],
> -			tmp[i + 3],
> -			tmp[i + 4],
> -			tmp[i + 5],
> -			tmp[i + 6],
> -			tmp[i + 7]);
> +		pr_err("%.08x: %.08x %.08x %.08x %.08x %.08x %.08x %.08x %.08x\n",
> +		       i,
> +		       tmp[i + 0],
> +		       tmp[i + 1],
> +		       tmp[i + 2],
> +		       tmp[i + 3],
> +		       tmp[i + 4],
> +		       tmp[i + 5],
> +		       tmp[i + 6],
> +		       tmp[i + 7]);

This should probably instead use

	print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 4,
		       qdev->mpi_coredump, sizeof(*qdev->mpi_coredump), false);

So that the debug and the dump are emitted at the
same KERN_<LEVEL> and the code is simpler.

>  		msleep(5);

And the msleep seems unnecessary.

>  	}
>  }


Perhaps:
---
 drivers/staging/qlge/qlge_dbg.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
index 8cf3961..a4cd91 100644
--- a/drivers/staging/qlge/qlge_dbg.c
+++ b/drivers/staging/qlge/qlge_dbg.c
@@ -1324,27 +1324,12 @@ void ql_mpi_core_to_log(struct work_struct *work)
 {
 	struct ql_adapter *qdev =
 		container_of(work, struct ql_adapter, mpi_core_to_log.work);
-	u32 *tmp, count;
-	int i;
 
-	count = sizeof(struct ql_mpi_coredump) / sizeof(u32);
-	tmp = (u32 *)qdev->mpi_coredump;
 	netif_printk(qdev, drv, KERN_DEBUG, qdev->ndev,
 		     "Core is dumping to log file!\n");
 
-	for (i = 0; i < count; i += 8) {
-		pr_err("%.08x: %.08x %.08x %.08x %.08x %.08x "
-			"%.08x %.08x %.08x\n", i,
-			tmp[i + 0],
-			tmp[i + 1],
-			tmp[i + 2],
-			tmp[i + 3],
-			tmp[i + 4],
-			tmp[i + 5],
-			tmp[i + 6],
-			tmp[i + 7]);
-		msleep(5);
-	}
+	print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 4,
+		       qdev->mpi_coredump, sizeof(*qdev->mpi_coredump), false);
 }
 
 #ifdef QL_REG_DUMP


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

* Re: [PATCH] staging: qlge: unify multi-line string
@ 2020-02-22  0:34   ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2020-02-22  0:34 UTC (permalink / raw)
  To: Kaaira Gupta, Manish Chopra, GR-Linux-NIC-Dev,
	Greg Kroah-Hartman, netdev, devel, linux-kernel

On Sat, 2020-02-22 at 00:20 +0530, Kaaira Gupta wrote:
> Fix checkpatch.pl warning of 'quoted string split across lines' in
> qlge_dbg.c by merging the strings in one line. Fixing this warning is
> necessary to ease grep-ing the source for printk.
[]
> diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
[]
> @@ -1333,16 +1333,16 @@ void ql_mpi_core_to_log(struct work_struct *work)
>  		     "Core is dumping to log file!\n");
>  
>  	for (i = 0; i < count; i += 8) {
> -		pr_err("%.08x: %.08x %.08x %.08x %.08x %.08x "
> -			"%.08x %.08x %.08x\n", i,
> -			tmp[i + 0],
> -			tmp[i + 1],
> -			tmp[i + 2],
> -			tmp[i + 3],
> -			tmp[i + 4],
> -			tmp[i + 5],
> -			tmp[i + 6],
> -			tmp[i + 7]);
> +		pr_err("%.08x: %.08x %.08x %.08x %.08x %.08x %.08x %.08x %.08x\n",
> +		       i,
> +		       tmp[i + 0],
> +		       tmp[i + 1],
> +		       tmp[i + 2],
> +		       tmp[i + 3],
> +		       tmp[i + 4],
> +		       tmp[i + 5],
> +		       tmp[i + 6],
> +		       tmp[i + 7]);

This should probably instead use

	print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 4,
		       qdev->mpi_coredump, sizeof(*qdev->mpi_coredump), false);

So that the debug and the dump are emitted at the
same KERN_<LEVEL> and the code is simpler.

>  		msleep(5);

And the msleep seems unnecessary.

>  	}
>  }


Perhaps:
---
 drivers/staging/qlge/qlge_dbg.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
index 8cf3961..a4cd91 100644
--- a/drivers/staging/qlge/qlge_dbg.c
+++ b/drivers/staging/qlge/qlge_dbg.c
@@ -1324,27 +1324,12 @@ void ql_mpi_core_to_log(struct work_struct *work)
 {
 	struct ql_adapter *qdev =
 		container_of(work, struct ql_adapter, mpi_core_to_log.work);
-	u32 *tmp, count;
-	int i;
 
-	count = sizeof(struct ql_mpi_coredump) / sizeof(u32);
-	tmp = (u32 *)qdev->mpi_coredump;
 	netif_printk(qdev, drv, KERN_DEBUG, qdev->ndev,
 		     "Core is dumping to log file!\n");
 
-	for (i = 0; i < count; i += 8) {
-		pr_err("%.08x: %.08x %.08x %.08x %.08x %.08x "
-			"%.08x %.08x %.08x\n", i,
-			tmp[i + 0],
-			tmp[i + 1],
-			tmp[i + 2],
-			tmp[i + 3],
-			tmp[i + 4],
-			tmp[i + 5],
-			tmp[i + 6],
-			tmp[i + 7]);
-		msleep(5);
-	}
+	print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 4,
+		       qdev->mpi_coredump, sizeof(*qdev->mpi_coredump), false);
 }
 
 #ifdef QL_REG_DUMP

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2020-02-22  0:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-21 18:50 [PATCH] staging: qlge: unify multi-line string Kaaira Gupta
2020-02-21 18:50 ` Kaaira Gupta
2020-02-22  0:34 ` Joe Perches
2020-02-22  0:34   ` Joe Perches

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.