From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-input@vger.kernel.org, Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH 4/4] Input-gameport: Replace some printk() calls by pr_info() in joydump_connect()
Date: Sat, 24 Sep 2016 15:50:36 +0200 [thread overview]
Message-ID: <f486d64d-0759-9cd6-1e4e-df723acb6fea@users.sourceforge.net> (raw)
In-Reply-To: <d8da8333-d83a-ca61-b887-7fd7528c63a4@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 24 Sep 2016 15:12:21 +0200
* Prefer usage of the macro "pr_info" over the interface "printk"
in this function.
* Reduce number of output function calls.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/input/joystick/joydump.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/input/joystick/joydump.c b/drivers/input/joystick/joydump.c
index a38f10e..02ea60c 100644
--- a/drivers/input/joystick/joydump.c
+++ b/drivers/input/joystick/joydump.c
@@ -57,27 +57,29 @@ static int joydump_connect(struct gameport *gameport, struct gameport_driver *dr
unsigned long flags;
unsigned char u;
- printk(KERN_INFO "joydump: ,------------------ START ----------------.\n");
- printk(KERN_INFO "joydump: | Dumping: %30s |\n", gameport->phys);
- printk(KERN_INFO "joydump: | Speed: %28d kHz |\n", gameport->speed);
+ pr_info(",------------------ START ----------------.\n"
+ "| Dumping: %30s |\n"
+ "| Speed: %28d kHz |\n",
+ gameport->phys,
+ gameport->speed);
if (gameport_open(gameport, drv, GAMEPORT_MODE_RAW)) {
-
- printk(KERN_INFO "joydump: | Raw mode not available - trying cooked. |\n");
-
+ pr_info("| Raw mode not available - trying cooked. |\n");
if (gameport_open(gameport, drv, GAMEPORT_MODE_COOKED)) {
-
- printk(KERN_INFO "joydump: | Cooked not available either. Failing. |\n");
- printk(KERN_INFO "joydump: `------------------- END -----------------'\n");
+ pr_info("| Cooked not available either. Failing. |\n"
+ "`------------------- END -----------------'\n");
return -ENODEV;
}
gameport_cooked_read(gameport, axes, &buttons);
for (i = 0; i < 4; i++)
- printk(KERN_INFO "joydump: | Axis %d: %4d. |\n", i, axes[i]);
- printk(KERN_INFO "joydump: | Buttons %02x. |\n", buttons);
- printk(KERN_INFO "joydump: `------------------- END -----------------'\n");
+ pr_info("| Axis %d: %4d. |\n",
+ i,
+ axes[i]);
+ pr_info("| Buttons %02x. |\n"
+ "`------------------- END -----------------'\n",
+ buttons);
}
timeout = gameport_time(gameport, 10000); /* 10 ms */
@@ -121,16 +123,15 @@ static int joydump_connect(struct gameport *gameport, struct gameport_driver *dr
t = i;
dump = buf;
prev = dump;
-
- printk(KERN_INFO "joydump: >------------------ DATA -----------------<\n");
- printk(KERN_INFO "joydump: | index: %3d delta: %3d us data: ", 0, 0);
+ pr_info(">------------------ DATA -----------------<\n"
+ "| index: %3d delta: %3d us data: ", 0, 0);
for (j = 7; j >= 0; j--)
printk("%d", (dump->data >> j) & 1);
printk(" |\n");
dump++;
for (i = 1; i < t; i++, dump++, prev++) {
- printk(KERN_INFO "joydump: | index: %3d delta: %3d us data: ",
+ pr_info("| index: %3d delta: %3d us data: ",
i, dump->time - prev->time);
for (j = 7; j >= 0; j--)
printk("%d", (dump->data >> j) & 1);
@@ -139,8 +140,7 @@ static int joydump_connect(struct gameport *gameport, struct gameport_driver *dr
kfree(buf);
jd_end:
- printk(KERN_INFO "joydump: `------------------- END -----------------'\n");
-
+ pr_info("`------------------- END -----------------'\n");
return 0;
}
--
2.10.0
next prev parent reply other threads:[~2016-09-24 13:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-24 13:45 [PATCH 0/4] Input-gameport: Fine-tuning for joydump_connect() SF Markus Elfring
2016-09-24 13:46 ` [PATCH 1/4] Input-gameport: Use kmalloc_array() in joydump_connect() SF Markus Elfring
2016-09-24 16:42 ` Dmitry Torokhov
2016-09-24 17:04 ` SF Markus Elfring
2016-09-24 13:47 ` [PATCH 2/4] Input-gameport: Delete an error message for a failed memory allocation SF Markus Elfring
2016-09-24 13:48 ` [PATCH 3/4] Input-gameport: Add the macro "pr_fmt" for module "joydump" SF Markus Elfring
2016-09-24 16:41 ` Dmitry Torokhov
2016-09-24 16:55 ` SF Markus Elfring
2016-09-24 17:03 ` Joe Perches
2016-09-24 17:45 ` SF Markus Elfring
2016-09-24 18:01 ` Joe Perches
2016-09-24 18:45 ` SF Markus Elfring
2016-09-24 13:50 ` SF Markus Elfring [this message]
2016-09-24 16:13 ` [PATCH 4/4] Input-gameport: Replace some printk() calls by pr_info() in joydump_connect() Joe Perches
2016-09-24 16:32 ` SF Markus Elfring
2016-09-24 16:39 ` Dmitry Torokhov
2016-09-24 17:20 ` SF Markus Elfring
2016-09-24 16:47 ` [PATCH 4/4] " Joe Perches
2016-09-24 19:50 ` SF Markus Elfring
2016-09-24 16:41 ` [PATCH 4/4] " SF Markus Elfring
2016-09-25 7:15 ` [PATCH v2 3/3] " SF Markus Elfring
2016-09-25 7:31 ` Joe Perches
2016-09-25 7: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=f486d64d-0759-9cd6-1e4e-df723acb6fea@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=dmitry.torokhov@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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