All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] thermal-Tegra: Fine-tuning for regs_show()
@ 2017-05-07  9:50 ` SF Markus Elfring
  0 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2017-05-07  9:50 UTC (permalink / raw)
  To: linux-tegra, linux-pm, Arnd Bergmann, Eduardo Valentin,
	Jonathan Hunter, Mikko Perttunen, Thierry Reding, Wei Ni,
	Zhang Rui
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 11:40:04 +0200

Three update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
  Combine two function calls into one
  Use seq_putc() in regs_show()
  Combine two seq_printf() calls into one

 drivers/thermal/tegra/soctherm.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

-- 
2.12.2

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

* [PATCH 0/3] thermal-Tegra: Fine-tuning for regs_show()
@ 2017-05-07  9:50 ` SF Markus Elfring
  0 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2017-05-07  9:50 UTC (permalink / raw)
  To: linux-tegra, linux-pm, Arnd Bergmann, Eduardo Valentin,
	Jonathan Hunter, Mikko Perttunen, Thierry Reding, Wei Ni,
	Zhang Rui
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 11:40:04 +0200

Three update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
  Combine two function calls into one
  Use seq_putc() in regs_show()
  Combine two seq_printf() calls into one

 drivers/thermal/tegra/soctherm.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

-- 
2.12.2


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

* [PATCH 1/3] thermal: tegra: Combine two function calls into one in regs_show()
  2017-05-07  9:50 ` SF Markus Elfring
@ 2017-05-07  9:51   ` SF Markus Elfring
  -1 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2017-05-07  9:51 UTC (permalink / raw)
  To: linux-tegra, linux-pm, Arnd Bergmann, Eduardo Valentin,
	Jonathan Hunter, Mikko Perttunen, Thierry Reding, Wei Ni,
	Zhang Rui
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 10:50:35 +0200

A bit of data was put into a sequence by two separate function calls
at two places. Print the same data by single function calls instead.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/thermal/tegra/soctherm.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index 7d2db23d71a3..c5871f9b6596 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -706,9 +706,7 @@ static int regs_show(struct seq_file *s, void *data)
 	seq_printf(s, "PDIV: 0x%x\n", r);
 
 	r = readl(ts->regs + SENSOR_HOTSPOT_OFF);
-	seq_printf(s, "HOTSPOT: 0x%x\n", r);
-
-	seq_puts(s, "\n");
+	seq_printf(s, "HOTSPOT: 0x%x\n\n", r);
 	seq_puts(s, "-----SOC_THERM-----\n");
 
 	r = readl(ts->regs + SENSOR_TEMP1);
@@ -809,9 +807,7 @@ static int regs_show(struct seq_file *s, void *data)
 	}
 
 	r = readl(ts->regs + THROT_GLOBAL_CFG);
-	seq_puts(s, "\n");
-	seq_printf(s, "GLOBAL THROTTLE CONFIG: 0x%08x\n", r);
-
+	seq_printf(s, "\nGLOBAL THROTTLE CONFIG: 0x%08x\n", r);
 	seq_puts(s, "---------------------------------------------------\n");
 	r = readl(ts->regs + THROT_STATUS);
 	state = REG_GET_MASK(r, THROT_STATUS_BREACH_MASK);
-- 
2.12.2

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

* [PATCH 1/3] thermal: tegra: Combine two function calls into one in regs_show()
@ 2017-05-07  9:51   ` SF Markus Elfring
  0 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2017-05-07  9:51 UTC (permalink / raw)
  To: linux-tegra, linux-pm, Arnd Bergmann, Eduardo Valentin,
	Jonathan Hunter, Mikko Perttunen, Thierry Reding, Wei Ni,
	Zhang Rui
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 10:50:35 +0200

A bit of data was put into a sequence by two separate function calls
at two places. Print the same data by single function calls instead.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/thermal/tegra/soctherm.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index 7d2db23d71a3..c5871f9b6596 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -706,9 +706,7 @@ static int regs_show(struct seq_file *s, void *data)
 	seq_printf(s, "PDIV: 0x%x\n", r);
 
 	r = readl(ts->regs + SENSOR_HOTSPOT_OFF);
-	seq_printf(s, "HOTSPOT: 0x%x\n", r);
-
-	seq_puts(s, "\n");
+	seq_printf(s, "HOTSPOT: 0x%x\n\n", r);
 	seq_puts(s, "-----SOC_THERM-----\n");
 
 	r = readl(ts->regs + SENSOR_TEMP1);
@@ -809,9 +807,7 @@ static int regs_show(struct seq_file *s, void *data)
 	}
 
 	r = readl(ts->regs + THROT_GLOBAL_CFG);
-	seq_puts(s, "\n");
-	seq_printf(s, "GLOBAL THROTTLE CONFIG: 0x%08x\n", r);
-
+	seq_printf(s, "\nGLOBAL THROTTLE CONFIG: 0x%08x\n", r);
 	seq_puts(s, "---------------------------------------------------\n");
 	r = readl(ts->regs + THROT_STATUS);
 	state = REG_GET_MASK(r, THROT_STATUS_BREACH_MASK);
-- 
2.12.2


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

* [PATCH 2/3] thermal: tegra: Use seq_putc() in regs_show()
  2017-05-07  9:50 ` SF Markus Elfring
  (?)
@ 2017-05-07  9:52     ` SF Markus Elfring
  -1 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2017-05-07  9:52 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann, Eduardo Valentin,
	Jonathan Hunter, Mikko Perttunen, Thierry Reding, Wei Ni,
	Zhang Rui
  Cc: LKML, kernel-janitors-u79uwXL29TY76Z2rM5mHXA

From: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Date: Sun, 7 May 2017 10:57:40 +0200

A single character (line break) should be put into a sequence.
Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
---
 drivers/thermal/tegra/soctherm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index c5871f9b6596..1b3915588bce 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -661,6 +661,6 @@ static int regs_show(struct seq_file *s, void *data)
 
 		if (!state) {
-			seq_puts(s, "\n");
+			seq_putc(s, '\n');
 			continue;
 		}
 
-- 
2.12.2

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

* [PATCH 2/3] thermal: tegra: Use seq_putc() in regs_show()
@ 2017-05-07  9:52     ` SF Markus Elfring
  0 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2017-05-07  9:52 UTC (permalink / raw)
  To: linux-tegra, linux-pm, Arnd Bergmann, Eduardo Valentin,
	Jonathan Hunter, Mikko Perttunen, Thierry Reding, Wei Ni,
	Zhang Rui
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 10:57:40 +0200

A single character (line break) should be put into a sequence.
Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/thermal/tegra/soctherm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index c5871f9b6596..1b3915588bce 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -661,6 +661,6 @@ static int regs_show(struct seq_file *s, void *data)
 
 		if (!state) {
-			seq_puts(s, "\n");
+			seq_putc(s, '\n');
 			continue;
 		}
 
-- 
2.12.2

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

* [PATCH 2/3] thermal: tegra: Use seq_putc() in regs_show()
@ 2017-05-07  9:52     ` SF Markus Elfring
  0 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2017-05-07  9:52 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann, Eduardo Valentin,
	Jonathan Hunter, Mikko Perttunen, Thierry Reding, Wei Ni,
	Zhang Rui
  Cc: LKML, kernel-janitors-u79uwXL29TY76Z2rM5mHXA

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 10:57:40 +0200

A single character (line break) should be put into a sequence.
Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/thermal/tegra/soctherm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index c5871f9b6596..1b3915588bce 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -661,6 +661,6 @@ static int regs_show(struct seq_file *s, void *data)
 
 		if (!state) {
-			seq_puts(s, "\n");
+			seq_putc(s, '\n');
 			continue;
 		}
 
-- 
2.12.2


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

* [PATCH 3/3] thermal: tegra: Combine two seq_printf() calls into one in regs_show()
  2017-05-07  9:50 ` SF Markus Elfring
  (?)
@ 2017-05-07  9:53     ` SF Markus Elfring
  -1 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2017-05-07  9:53 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann, Eduardo Valentin,
	Jonathan Hunter, Mikko Perttunen, Thierry Reding, Wei Ni,
	Zhang Rui
  Cc: LKML, kernel-janitors-u79uwXL29TY76Z2rM5mHXA

From: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Date: Sun, 7 May 2017 11:08:42 +0200

A bit of data was put into a sequence by two separate function calls.
Print the same data by a single function call instead.

Signed-off-by: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
---
 drivers/thermal/tegra/soctherm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index 1b3915588bce..3024c4294131 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -655,8 +655,6 @@ static int regs_show(struct seq_file *s, void *data)
 	for (i = 0; i < ts->soc->num_tsensors; i++) {
 		r = readl(ts->regs + tsensors[i].base + SENSOR_CONFIG1);
 		state = REG_GET_MASK(r, SENSOR_CONFIG1_TEMP_ENABLE);
-
-		seq_printf(s, "%s: ", tsensors[i].name);
-		seq_printf(s, "En(%d) ", state);
+		seq_printf(s, "%s: En(%d) ", tsensors[i].name, state);
 
 		if (!state) {
-- 
2.12.2

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

* [PATCH 3/3] thermal: tegra: Combine two seq_printf() calls into one in regs_show()
@ 2017-05-07  9:53     ` SF Markus Elfring
  0 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2017-05-07  9:53 UTC (permalink / raw)
  To: linux-tegra, linux-pm, Arnd Bergmann, Eduardo Valentin,
	Jonathan Hunter, Mikko Perttunen, Thierry Reding, Wei Ni,
	Zhang Rui
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 11:08:42 +0200

A bit of data was put into a sequence by two separate function calls.
Print the same data by a single function call instead.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/thermal/tegra/soctherm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index 1b3915588bce..3024c4294131 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -655,8 +655,6 @@ static int regs_show(struct seq_file *s, void *data)
 	for (i = 0; i < ts->soc->num_tsensors; i++) {
 		r = readl(ts->regs + tsensors[i].base + SENSOR_CONFIG1);
 		state = REG_GET_MASK(r, SENSOR_CONFIG1_TEMP_ENABLE);
-
-		seq_printf(s, "%s: ", tsensors[i].name);
-		seq_printf(s, "En(%d) ", state);
+		seq_printf(s, "%s: En(%d) ", tsensors[i].name, state);
 
 		if (!state) {
-- 
2.12.2

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

* [PATCH 3/3] thermal: tegra: Combine two seq_printf() calls into one in regs_show()
@ 2017-05-07  9:53     ` SF Markus Elfring
  0 siblings, 0 replies; 10+ messages in thread
From: SF Markus Elfring @ 2017-05-07  9:53 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann, Eduardo Valentin,
	Jonathan Hunter, Mikko Perttunen, Thierry Reding, Wei Ni,
	Zhang Rui
  Cc: LKML, kernel-janitors-u79uwXL29TY76Z2rM5mHXA

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 11:08:42 +0200

A bit of data was put into a sequence by two separate function calls.
Print the same data by a single function call instead.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/thermal/tegra/soctherm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index 1b3915588bce..3024c4294131 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -655,8 +655,6 @@ static int regs_show(struct seq_file *s, void *data)
 	for (i = 0; i < ts->soc->num_tsensors; i++) {
 		r = readl(ts->regs + tsensors[i].base + SENSOR_CONFIG1);
 		state = REG_GET_MASK(r, SENSOR_CONFIG1_TEMP_ENABLE);
-
-		seq_printf(s, "%s: ", tsensors[i].name);
-		seq_printf(s, "En(%d) ", state);
+		seq_printf(s, "%s: En(%d) ", tsensors[i].name, state);
 
 		if (!state) {
-- 
2.12.2


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

end of thread, other threads:[~2017-05-07 23:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-07  9:50 [PATCH 0/3] thermal-Tegra: Fine-tuning for regs_show() SF Markus Elfring
2017-05-07  9:50 ` SF Markus Elfring
2017-05-07  9:51 ` [PATCH 1/3] thermal: tegra: Combine two function calls into one in regs_show() SF Markus Elfring
2017-05-07  9:51   ` SF Markus Elfring
     [not found] ` <b0795133-ebb9-56b3-567d-b3773f298789-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-05-07  9:52   ` [PATCH 2/3] thermal: tegra: Use seq_putc() " SF Markus Elfring
2017-05-07  9:52     ` SF Markus Elfring
2017-05-07  9:52     ` SF Markus Elfring
2017-05-07  9:53   ` [PATCH 3/3] thermal: tegra: Combine two seq_printf() calls into one " SF Markus Elfring
2017-05-07  9:53     ` SF Markus Elfring
2017-05-07  9:53     ` SF Markus Elfring

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.