From: Joe Perches <joe@perches.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] staging: i2o: Remove uses of return value of seq_printf
Date: Tue, 17 Feb 2015 11:02:49 -0800 [thread overview]
Message-ID: <1424199769.25416.1.camel@perches.com> (raw)
Even though this subsystem will go away soonish, using
the return value of seq_printf prevents changing the
return type of seq_<foo> functions to void.
This allows seq_<foo> functions to become void functions
without breaking compilation if this subsystem isn't
deleted before the seq_<foo> functions are converted.
Eliminate these uses by changing the return value of
the enclosing i2o_report_query_status function to void.
Nothing uses the return value of this function.
Change one fixed string to seq_puts just to keep the
silly patch checker quiet.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/staging/i2o/i2o_proc.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/i2o/i2o_proc.c b/drivers/staging/i2o/i2o_proc.c
index ad84f33..6074eab 100644
--- a/drivers/staging/i2o/i2o_proc.c
+++ b/drivers/staging/i2o/i2o_proc.c
@@ -261,20 +261,23 @@ static char *chtostr(char *tmp, u8 *chars, int n)
return strncat(tmp, (char *)chars, n);
}
-static int i2o_report_query_status(struct seq_file *seq, int block_status,
- char *group)
+static void i2o_report_query_status(struct seq_file *seq, int block_status,
+ char *group)
{
switch (block_status) {
case -ETIMEDOUT:
- return seq_printf(seq, "Timeout reading group %s.\n", group);
+ seq_printf(seq, "Timeout reading group %s.\n", group);
+ break;
case -ENOMEM:
- return seq_printf(seq, "No free memory to read the table.\n");
+ seq_puts(seq, "No free memory to read the table.\n");
+ break;
case -I2O_PARAMS_STATUS_INVALID_GROUP_ID:
- return seq_printf(seq, "Group %s not supported.\n", group);
+ seq_printf(seq, "Group %s not supported.\n", group);
+ break;
default:
- return seq_printf(seq,
- "Error reading group %s. BlockStatus 0x%02X\n",
- group, -block_status);
+ seq_printf(seq, "Error reading group %s. BlockStatus 0x%02X\n",
+ group, -block_status);
+ break;
}
}
reply other threads:[~2015-02-17 19:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1424199769.25416.1.camel@perches.com \
--to=joe@perches.com \
--cc=gregkh@linuxfoundation.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