From: Daniel Hamacher <danielhamacher.dh@gmail.com>
To: greg@kroah.com
Cc: abbotti@mev.co.uk, fmhess@users.sourceforge.net,
linux-kernel@vger.kernel.org,
Daniel Hamacher <danielhamacher.dh@gmail.com>
Subject: [PATCH] staging: comedi: proc.c Fixed warning and brace code style issue [kernel: linux-next: next-20130607]
Date: Fri, 7 Jun 2013 01:36:18 -0600 [thread overview]
Message-ID: <1370590578-5700-1-git-send-email-danielhamacher.dh@gmail.com> (raw)
checkpatch provided a warning on line 38. It recommended seq_puts instead of seq_printf.
Since the return value of printf is ignored, I decided to switch to the seq_puts
function since it is just regular character output.
source:: http://lwn.net/Articles/22355/
I also added braces on a for loop, since loops should be in braces.
source:: Documentation/CodingStyle
Signed-off-by: Daniel Hamcher <danielhamacher.dh@gmail.com>
---
drivers/staging/comedi/proc.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/comedi/proc.c b/drivers/staging/comedi/proc.c
index 8ee9442..5cf19b3 100644
--- a/drivers/staging/comedi/proc.c
+++ b/drivers/staging/comedi/proc.c
@@ -34,11 +34,11 @@ static int comedi_read(struct seq_file *m, void *v)
int devices_q = 0;
struct comedi_driver *driv;
- seq_printf(m,
- "comedi version " COMEDI_RELEASE "\n"
- "format string: %s\n",
- "\"%2d: %-20s %-20s %4d\", i, "
- "driver_name, board_name, n_subdevices");
+ seq_puts(m,
+ "comedi version " COMEDI_RELEASE "\n"
+ "format string: %s\n",
+ "\"%2d: %-20s %-20s %4d\", i, "
+ "driver_name, board_name, n_subdevices");
for (i = 0; i < COMEDI_NUM_BOARD_MINORS; i++) {
struct comedi_device *dev = comedi_dev_from_minor(i);
@@ -57,10 +57,11 @@ static int comedi_read(struct seq_file *m, void *v)
for (driv = comedi_drivers; driv; driv = driv->next) {
seq_printf(m, "%s:\n", driv->driver_name);
- for (i = 0; i < driv->num_names; i++)
+ for (i = 0; i < driv->num_names; i++) {
seq_printf(m, " %s\n",
*(char **)((char *)driv->board_name +
i * driv->offset));
+ }
if (!driv->num_names)
seq_printf(m, " %s\n", driv->driver_name);
--
1.7.11.7
next reply other threads:[~2013-06-07 7:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 7:36 Daniel Hamacher [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-06-07 7:27 Daniel Hamacher
2013-06-07 7:47 ` Joe Perches
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=1370590578-5700-1-git-send-email-danielhamacher.dh@gmail.com \
--to=danielhamacher.dh@gmail.com \
--cc=abbotti@mev.co.uk \
--cc=fmhess@users.sourceforge.net \
--cc=greg@kroah.com \
--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
all inboxes | Powered by JetHome®