lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a7428302-6ee3-59be-72ed-01048e51a403@users.sourceforge.net>
Date:   Thu, 12 Oct 2017 12:49:18 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     devel@...verdev.osuosl.org, netdev@...r.kernel.org,
        Al Viro <viro@...iv.linux.org.uk>,
        Corentin Labbe <clabbe.montjoie@...il.com>,
        David Howells <dhowells@...hat.com>,
        "David S. Miller" <davem@...emloft.net>,
        Georgiana Chelu <georgiana.chelu93@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Johannes Berg <johannes.berg@...el.com>,
        Julia Lawall <julia.lawall@...6.fr>,
        Samuel Ortiz <samuel@...tiz.org>,
        Srishti Sharma <srishtishar@...il.com>,
        Stephen Hemminger <stephen@...workplumber.org>,
        Yuan Linyu <Linyu.Yuan@...atel-sbell.com.cn>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 09/10] staging/irda/net: Combine some seq_printf() calls in
 two functions

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 12 Oct 2017 08:58:38 +0200

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

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/staging/irda/net/irlap.c | 9 ++++-----
 drivers/staging/irda/net/irlmp.c | 6 ++----
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/irda/net/irlap.c b/drivers/staging/irda/net/irlap.c
index 715cedab2f41..345c4eb55a59 100644
--- a/drivers/staging/irda/net/irlap.c
+++ b/drivers/staging/irda/net/irlap.c
@@ -1141,9 +1141,9 @@ static int irlap_seq_show(struct seq_file *seq, void *v)
 	seq_printf(seq, "vr: %d ", self->vr);
 	seq_printf(seq, "va: %d\n", self->va);
 
-	seq_printf(seq, "  qos\tbps\tmaxtt\tdsize\twinsize\taddbofs\tmintt\tldisc\tcomp\n");
-
-	seq_printf(seq, "  tx\t%d\t",
+	seq_printf(seq,
+		   "  qos\tbps\tmaxtt\tdsize\twinsize\taddbofs\tmintt\tldisc\tcomp\n"
+		   "  tx\t%d\t",
 		   self->qos_tx.baud_rate.value);
 	seq_printf(seq, "%d\t",
 		   self->qos_tx.max_turn_time.value);
@@ -1157,9 +1157,8 @@ static int irlap_seq_show(struct seq_file *seq, void *v)
 		   self->qos_tx.min_turn_time.value);
 	seq_printf(seq, "%d\t",
 		   self->qos_tx.link_disc_time.value);
-	seq_printf(seq, "\n");
 
-	seq_printf(seq, "  rx\t%d\t",
+	seq_printf(seq, "\n  rx\t%d\t",
 		   self->qos_rx.baud_rate.value);
 	seq_printf(seq, "%d\t",
 		   self->qos_rx.max_turn_time.value);
diff --git a/drivers/staging/irda/net/irlmp.c b/drivers/staging/irda/net/irlmp.c
index 318660fbc094..6a09cf621bd4 100644
--- a/drivers/staging/irda/net/irlmp.c
+++ b/drivers/staging/irda/net/irlmp.c
@@ -1920,8 +1920,7 @@ static int irlmp_seq_show(struct seq_file *seq, void *v)
 		seq_printf(seq,
 			   "slsap_sel: %#02x, dlsap_sel: %#02x, ",
 			   self->slsap_sel, self->dlsap_sel);
-		seq_printf(seq, "(%s)", self->notify.name);
-		seq_printf(seq, "\n");
+		seq_printf(seq, "(%s)\n", self->notify.name);
 	} else if (iter->hashbin == irlmp->links) {
 		struct lap_cb *lap = v;
 
@@ -1930,9 +1929,8 @@ static int irlmp_seq_show(struct seq_file *seq, void *v)
 
 		seq_printf(seq, "saddr: %#08x, daddr: %#08x, ",
 			   lap->saddr, lap->daddr);
-		seq_printf(seq, "num lsaps: %d",
+		seq_printf(seq, "num lsaps: %d\n",
 			   HASHBIN_GET_SIZE(lap->lsaps));
-		seq_printf(seq, "\n");
 
 		/* Careful for priority inversions here !
 		 * All other uses of attrib spinlock are independent of
-- 
2.14.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ