From: SF Markus Elfring <elfring@users.sourceforge.net>
To: devel@driverdev.osuosl.org, netdev@vger.kernel.org,
Al Viro <viro@zeniv.linux.org.uk>,
Corentin Labbe <clabbe.montjoie@gmail.com>,
David Howells <dhowells@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
Georgiana Chelu <georgiana.chelu93@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Johannes Berg <johannes.berg@intel.com>,
Julia Lawall <julia.lawall@lip6.fr>,
Samuel Ortiz <samuel@sortiz.org>,
Srishti Sharma <srishtishar@gmail.com>,
Stephen Hemminger <stephen@networkplumber.org>,
Yuan Linyu <Linyu.Yuan@alcatel-sbell.com.cn>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 09/10] staging/irda/net: Combine some seq_printf() calls in two functions
Date: Thu, 12 Oct 2017 12:49:18 +0200 [thread overview]
Message-ID: <a7428302-6ee3-59be-72ed-01048e51a403@users.sourceforge.net> (raw)
In-Reply-To: <8152401b-d68d-c4fe-2619-82a09e0c52ec@users.sourceforge.net>
From: Markus Elfring <elfring@users.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@users.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
next prev parent reply other threads:[~2017-10-12 10:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-12 10:38 [PATCH 00/10] staging/irda/net: Adjustments for several function implementations SF Markus Elfring
2017-10-12 10:39 ` [PATCH 01/10] staging: irda: Improve a size determination in 20 functions SF Markus Elfring
2017-10-12 10:40 ` [PATCH 02/10] staging: irda: Delete ten error messages for a failed memory allocation SF Markus Elfring
2017-10-12 10:42 ` [PATCH 03/10] staging/irda/net: Adjust 385 checks for null pointers SF Markus Elfring
2017-10-12 10:43 ` [PATCH 04/10] staging/irda/net: Delete an unnecessary variable initialisation in irlap_recv_discovery_xid_cmd() SF Markus Elfring
2017-10-12 10:45 ` [PATCH 05/10] staging/irda/net: Delete an unnecessary variable initialisation in irlap_recv_discovery_xid_rsp() SF Markus Elfring
2017-10-12 10:46 ` [PATCH 06/10] staging/irda/net: Delete an unnecessary variable initialisation in two functions SF Markus Elfring
2017-10-12 10:47 ` [PATCH 07/10] staging/irda/net: Delete an unnecessary variable initialisation in four functions SF Markus Elfring
2017-10-12 10:48 ` [PATCH 08/10] staging/irda/net: Use common error handling code in irias_new_object() SF Markus Elfring
2017-10-12 10:49 ` SF Markus Elfring [this message]
2017-10-12 10:50 ` [PATCH 10/10] staging/irda/net: Use seq_puts() in four functions SF Markus Elfring
2017-10-12 11:17 ` [PATCH 00/10] staging/irda/net: Adjustments for several function implementations Bjørn Mork
2017-10-12 13:45 ` SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a7428302-6ee3-59be-72ed-01048e51a403@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=Linyu.Yuan@alcatel-sbell.com.cn \
--cc=clabbe.montjoie@gmail.com \
--cc=davem@davemloft.net \
--cc=devel@driverdev.osuosl.org \
--cc=dhowells@redhat.com \
--cc=georgiana.chelu93@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=johannes.berg@intel.com \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=samuel@sortiz.org \
--cc=srishtishar@gmail.com \
--cc=stephen@networkplumber.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).