linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] AVR32-AT32AP: Fine-tuning for three function implementations
@ 2016-10-16 20:32 SF Markus Elfring
  2016-10-16 20:33 ` [PATCH 1/4] AVR32-clock: Use seq_putc() in two functions SF Markus Elfring
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: SF Markus Elfring @ 2016-10-16 20:32 UTC (permalink / raw)
  To: Haavard Skinnemoen, Hans-Christian Egtvedt; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 16 Oct 2016 22:30:22 +0200

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

Markus Elfring (4):
  clock: Use seq_putc() in two functions
  clock: Combine nine seq_printf() calls into one call in clk_show()
  pio: Use seq_putc() in pio_bank_show()
  pio: Replace two seq_printf() calls by seq_puts() in pio_bank_show()

 arch/avr32/mach-at32ap/clock.c | 33 +++++++++++++++++++++------------
 arch/avr32/mach-at32ap/pio.c   |  6 +++---
 2 files changed, 24 insertions(+), 15 deletions(-)

-- 
2.10.1

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

* [PATCH 1/4] AVR32-clock: Use seq_putc() in two functions
  2016-10-16 20:32 [PATCH 0/4] AVR32-AT32AP: Fine-tuning for three function implementations SF Markus Elfring
@ 2016-10-16 20:33 ` SF Markus Elfring
  2016-10-16 20:34 ` [PATCH 2/4] AVR32-clock: Combine nine seq_printf() calls into one call in clk_show() SF Markus Elfring
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2016-10-16 20:33 UTC (permalink / raw)
  To: Haavard Skinnemoen, Hans-Christian Egtvedt; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 16 Oct 2016 21:51:09 +0200

A single character (line break) should be put into two sequences.
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>
---
 arch/avr32/mach-at32ap/clock.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/avr32/mach-at32ap/clock.c b/arch/avr32/mach-at32ap/clock.c
index 52c179b..a912a72 100644
--- a/arch/avr32/mach-at32ap/clock.c
+++ b/arch/avr32/mach-at32ap/clock.c
@@ -242,7 +242,7 @@ dump_clock(struct clk *parent, struct clkinf *r)
 		clk_get_rate(parent));
 	if (parent->dev)
 		seq_printf(r->s, ", for %s", dev_name(parent->dev));
-	seq_printf(r->s, "\n");
+	seq_putc(r->s, '\n');
 
 	/* cost of this scan is small, but not linear... */
 	r->nest = nest + NEST_DELTA;
@@ -276,8 +276,7 @@ static int clk_show(struct seq_file *s, void *unused)
 		seq_printf(s, "GCCTRL%d = %8x\n", i, pm_readl(GCCTRL(i)));
 	}
 
-	seq_printf(s, "\n");
-
+	seq_putc(s, '\n');
 	r.s = s;
 	r.nest = 0;
 	/* protected from changes on the list while dumping */
-- 
2.10.1

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

* [PATCH 2/4] AVR32-clock: Combine nine seq_printf() calls into one call in clk_show()
  2016-10-16 20:32 [PATCH 0/4] AVR32-AT32AP: Fine-tuning for three function implementations SF Markus Elfring
  2016-10-16 20:33 ` [PATCH 1/4] AVR32-clock: Use seq_putc() in two functions SF Markus Elfring
@ 2016-10-16 20:34 ` SF Markus Elfring
  2016-10-16 20:35 ` [PATCH 3/4] AVR32-pio: Use seq_putc() in pio_bank_show() SF Markus Elfring
  2016-10-16 20:36 ` [PATCH 4/4] AVR32-pio: Replace two seq_printf() calls by seq_puts() " SF Markus Elfring
  3 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2016-10-16 20:34 UTC (permalink / raw)
  To: Haavard Skinnemoen, Hans-Christian Egtvedt; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 16 Oct 2016 22:04:10 +0200

Some data were printed into a sequence by nine separate function calls.
Print the same data by a single function call instead.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/avr32/mach-at32ap/clock.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/arch/avr32/mach-at32ap/clock.c b/arch/avr32/mach-at32ap/clock.c
index a912a72..fdf1cae 100644
--- a/arch/avr32/mach-at32ap/clock.c
+++ b/arch/avr32/mach-at32ap/clock.c
@@ -261,15 +261,25 @@ static int clk_show(struct seq_file *s, void *unused)
 	struct clk 	*clk;
 
 	/* show all the power manager registers */
-	seq_printf(s, "MCCTRL  = %8x\n", pm_readl(MCCTRL));
-	seq_printf(s, "CKSEL   = %8x\n", pm_readl(CKSEL));
-	seq_printf(s, "CPUMASK = %8x\n", pm_readl(CPU_MASK));
-	seq_printf(s, "HSBMASK = %8x\n", pm_readl(HSB_MASK));
-	seq_printf(s, "PBAMASK = %8x\n", pm_readl(PBA_MASK));
-	seq_printf(s, "PBBMASK = %8x\n", pm_readl(PBB_MASK));
-	seq_printf(s, "PLL0    = %8x\n", pm_readl(PLL0));
-	seq_printf(s, "PLL1    = %8x\n", pm_readl(PLL1));
-	seq_printf(s, "IMR     = %8x\n", pm_readl(IMR));
+	seq_printf(s,
+		   "MCCTRL  = %8x\n"
+		   "CKSEL   = %8x\n"
+		   "CPUMASK = %8x\n"
+		   "HSBMASK = %8x\n"
+		   "PBAMASK = %8x\n"
+		   "PBBMASK = %8x\n"
+		   "PLL0    = %8x\n"
+		   "PLL1    = %8x\n"
+		   "IMR     = %8x\n",
+		   pm_readl(MCCTRL),
+		   pm_readl(CKSEL),
+		   pm_readl(CPU_MASK),
+		   pm_readl(HSB_MASK),
+		   pm_readl(PBA_MASK),
+		   pm_readl(PBB_MASK),
+		   pm_readl(PLL0),
+		   pm_readl(PLL1),
+		   pm_readl(IMR));
 	for (i = 0; i < 8; i++) {
 		if (i == 5)
 			continue;
-- 
2.10.1

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

* [PATCH 3/4] AVR32-pio: Use seq_putc() in pio_bank_show()
  2016-10-16 20:32 [PATCH 0/4] AVR32-AT32AP: Fine-tuning for three function implementations SF Markus Elfring
  2016-10-16 20:33 ` [PATCH 1/4] AVR32-clock: Use seq_putc() in two functions SF Markus Elfring
  2016-10-16 20:34 ` [PATCH 2/4] AVR32-clock: Combine nine seq_printf() calls into one call in clk_show() SF Markus Elfring
@ 2016-10-16 20:35 ` SF Markus Elfring
  2016-10-16 20:36 ` [PATCH 4/4] AVR32-pio: Replace two seq_printf() calls by seq_puts() " SF Markus Elfring
  3 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2016-10-16 20:35 UTC (permalink / raw)
  To: Haavard Skinnemoen, Hans-Christian Egtvedt; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 16 Oct 2016 22:13:19 +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>
---
 arch/avr32/mach-at32ap/pio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c
index 13d3fc4..abbe1b5 100644
--- a/arch/avr32/mach-at32ap/pio.c
+++ b/arch/avr32/mach-at32ap/pio.c
@@ -373,7 +373,7 @@ static void pio_bank_show(struct seq_file *s, struct gpio_chip *chip)
 		if (imr & mask)
 			seq_printf(s, " irq-%d edge-both",
 				gpio_to_irq(chip->base + i));
-		seq_printf(s, "\n");
+		seq_putc(s, '\n');
 	}
 }
 
-- 
2.10.1

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

* [PATCH 4/4] AVR32-pio: Replace two seq_printf() calls by seq_puts() in pio_bank_show()
  2016-10-16 20:32 [PATCH 0/4] AVR32-AT32AP: Fine-tuning for three function implementations SF Markus Elfring
                   ` (2 preceding siblings ...)
  2016-10-16 20:35 ` [PATCH 3/4] AVR32-pio: Use seq_putc() in pio_bank_show() SF Markus Elfring
@ 2016-10-16 20:36 ` SF Markus Elfring
  2016-10-23 11:58   ` Hans-Christian Noren Egtvedt
  3 siblings, 1 reply; 6+ messages in thread
From: SF Markus Elfring @ 2016-10-16 20:36 UTC (permalink / raw)
  To: Haavard Skinnemoen, Hans-Christian Egtvedt; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 16 Oct 2016 22:18:31 +0200

Strings which did not contain data format specifications should be put
into a sequence. Thus use the corresponding function "seq_puts".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/avr32/mach-at32ap/pio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c
index abbe1b5..7fae6ec 100644
--- a/arch/avr32/mach-at32ap/pio.c
+++ b/arch/avr32/mach-at32ap/pio.c
@@ -367,9 +367,9 @@ static void pio_bank_show(struct seq_file *s, struct gpio_chip *chip)
 			(mask & pdsr) ? "hi" : "lo",
 			(mask & pusr) ? "  " : "up");
 		if (ifsr & mask)
-			seq_printf(s, " deglitch");
+			seq_puts(s, " deglitch");
 		if ((osr & mdsr) & mask)
-			seq_printf(s, " open-drain");
+			seq_puts(s, " open-drain");
 		if (imr & mask)
 			seq_printf(s, " irq-%d edge-both",
 				gpio_to_irq(chip->base + i));
-- 
2.10.1

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

* Re: [PATCH 4/4] AVR32-pio: Replace two seq_printf() calls by seq_puts() in pio_bank_show()
  2016-10-16 20:36 ` [PATCH 4/4] AVR32-pio: Replace two seq_printf() calls by seq_puts() " SF Markus Elfring
@ 2016-10-23 11:58   ` Hans-Christian Noren Egtvedt
  0 siblings, 0 replies; 6+ messages in thread
From: Hans-Christian Noren Egtvedt @ 2016-10-23 11:58 UTC (permalink / raw)
  To: SF Markus Elfring; +Cc: Haavard Skinnemoen, LKML, kernel-janitors

Around Sun 16 Oct 2016 22:36:24 +0200 or thereabout, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 16 Oct 2016 22:18:31 +0200
> 
> Strings which did not contain data format specifications should be put
> into a sequence. Thus use the corresponding function "seq_puts".
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

This series of four patches look good to me, I will append them to for-linus
and push them for next merge window.

Thanks.

Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>

> ---
>  arch/avr32/mach-at32ap/pio.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

<snipp diff>

-- 
mvh
Hans-Christian Noren Egtvedt

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

end of thread, other threads:[~2016-10-23 11:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-16 20:32 [PATCH 0/4] AVR32-AT32AP: Fine-tuning for three function implementations SF Markus Elfring
2016-10-16 20:33 ` [PATCH 1/4] AVR32-clock: Use seq_putc() in two functions SF Markus Elfring
2016-10-16 20:34 ` [PATCH 2/4] AVR32-clock: Combine nine seq_printf() calls into one call in clk_show() SF Markus Elfring
2016-10-16 20:35 ` [PATCH 3/4] AVR32-pio: Use seq_putc() in pio_bank_show() SF Markus Elfring
2016-10-16 20:36 ` [PATCH 4/4] AVR32-pio: Replace two seq_printf() calls by seq_puts() " SF Markus Elfring
2016-10-23 11:58   ` Hans-Christian Noren Egtvedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).