From: Joel Stanley <joel@jms.id.au>
To: benh@kernel.crashing.org
Cc: neelegup@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org,
paulus@samba.org
Subject: [PATCH 2/5] powerpc/powernv: Use ssize_t for sysparam return values
Date: Thu, 24 Apr 2014 16:55:34 +0930 [thread overview]
Message-ID: <1398324337-896-3-git-send-email-joel@jms.id.au> (raw)
In-Reply-To: <1398324337-896-1-git-send-email-joel@jms.id.au>
The OPAL calls are returning int64_t values, which the sysparam code
stores in an int, and the sysfs callback returns ssize_t. Make code a
easier to read by consistently using ssize_t.
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
arch/powerpc/platforms/powernv/opal-sysparam.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal-sysparam.c b/arch/powerpc/platforms/powernv/opal-sysparam.c
index cdaf145..a363c53 100644
--- a/arch/powerpc/platforms/powernv/opal-sysparam.c
+++ b/arch/powerpc/platforms/powernv/opal-sysparam.c
@@ -39,10 +39,11 @@ struct param_attr {
struct kobj_attribute kobj_attr;
};
-static int opal_get_sys_param(u32 param_id, u32 length, void *buffer)
+static ssize_t opal_get_sys_param(u32 param_id, u32 length, void *buffer)
{
struct opal_msg msg;
- int ret, token;
+ ssize_t ret;
+ int token;
token = opal_async_get_token_interruptible();
if (token < 0) {
@@ -59,7 +60,7 @@ static int opal_get_sys_param(u32 param_id, u32 length, void *buffer)
ret = opal_async_wait_response(token, &msg);
if (ret) {
- pr_err("%s: Failed to wait for the async response, %d\n",
+ pr_err("%s: Failed to wait for the async response, %zd\n",
__func__, ret);
goto out_token;
}
@@ -111,7 +112,7 @@ static ssize_t sys_param_show(struct kobject *kobj,
{
struct param_attr *attr = container_of(kobj_attr, struct param_attr,
kobj_attr);
- int ret;
+ ssize_t ret;
mutex_lock(&opal_sysparam_mutex);
ret = opal_get_sys_param(attr->param_id, attr->param_size,
@@ -132,7 +133,7 @@ static ssize_t sys_param_store(struct kobject *kobj,
{
struct param_attr *attr = container_of(kobj_attr, struct param_attr,
kobj_attr);
- int ret;
+ ssize_t ret;
mutex_lock(&opal_sysparam_mutex);
memcpy(param_data_buf, buf, count);
--
1.9.1
next prev parent reply other threads:[~2014-04-24 7:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-24 7:25 [PATCH 0/5] powerpc/powernv: OPAL sysparam sysfs fixes Joel Stanley
2014-04-24 7:25 ` [PATCH 1/5] powerpc/powernv: Fix sysparam sysfs error handling Joel Stanley
2014-04-24 7:25 ` Joel Stanley [this message]
2014-04-24 7:25 ` [PATCH 3/5] powerpc/powernv: Check sysfs size before copying Joel Stanley
2014-04-24 7:25 ` [PATCH 4/5] powerpc/powernv: Fix typos in sysparam code Joel Stanley
2014-04-24 7:25 ` [PATCH 5/5] powerpc/powernv: Check sysparam size before creation Joel Stanley
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=1398324337-896-3-git-send-email-joel@jms.id.au \
--to=joel@jms.id.au \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=neelegup@linux.vnet.ibm.com \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).