From: Laurent Navet <laurent.navet@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andreas Dilger <andreas.dilger@intel.com>,
Peng Tao <tao.peng@emc.com>, Niu Yawei <yawei.niu@intel.com>,
Oleg Drokin <oleg.drokin@intel.com>,
Alex Zhuravlev <alexey.zhuravlev@intel.com>,
Fan Yong <fan.yong@intel.com>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Laurent Navet <laurent.navet@gmail.com>
Subject: [PATCH] staging: lustre: use ERR_CAST() function
Date: Fri, 5 Jul 2013 14:26:33 +0200 [thread overview]
Message-ID: <1373027193-7565-1-git-send-email-laurent.navet@gmail.com> (raw)
use ERR_CAST() function instead of ERR_PTR() and PTR_ERR()
found using coccinelle and err_cast.cocci
Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
---
drivers/staging/lustre/lustre/llite/llite_nfs.c | 2 +-
drivers/staging/lustre/lustre/llite/rw.c | 2 +-
drivers/staging/lustre/lustre/obdclass/local_storage.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index 28cc41e..d2c459c 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -131,7 +131,7 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *paren
inode = search_inode_for_lustre(sb, fid);
if (IS_ERR(inode))
- RETURN(ERR_PTR(PTR_ERR(inode)));
+ RETURN(ERR_CAST(inode));
if (is_bad_inode(inode)) {
/* we didn't find the right inode.. */
diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c
index fac1178..30e98ed 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -110,7 +110,7 @@ static struct ll_cl_context *ll_cl_init(struct file *file,
env = cl_env_get(&refcheck);
if (IS_ERR(env))
- return ERR_PTR(PTR_ERR(env));
+ return ERR_CAST(env);
lcc = &vvp_env_info(env)->vti_io_ctx;
memset(lcc, 0, sizeof(*lcc));
diff --git a/drivers/staging/lustre/lustre/obdclass/local_storage.c b/drivers/staging/lustre/lustre/obdclass/local_storage.c
index 3be35a8..e1db7ab 100644
--- a/drivers/staging/lustre/lustre/obdclass/local_storage.c
+++ b/drivers/staging/lustre/lustre/obdclass/local_storage.c
@@ -443,7 +443,7 @@ struct dt_object *local_file_find_or_create_with_fid(const struct lu_env *env,
ls = ls_device_get(dt);
if (IS_ERR(ls)) {
- dto = ERR_PTR(PTR_ERR(ls));
+ dto = ERR_CAST(ls);
} else {
/* create the object */
dti->dti_attr.la_valid = LA_MODE;
@@ -537,7 +537,7 @@ local_index_find_or_create_with_fid(const struct lu_env *env,
ls = ls_device_get(dt);
if (IS_ERR(ls)) {
- dto = ERR_PTR(PTR_ERR(ls));
+ dto = ERR_CAST(ls);
} else {
/* create the object */
dti->dti_attr.la_valid = LA_MODE;
--
1.7.10.4
reply other threads:[~2013-07-05 12:15 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=1373027193-7565-1-git-send-email-laurent.navet@gmail.com \
--to=laurent.navet@gmail.com \
--cc=alexey.zhuravlev@intel.com \
--cc=andreas.dilger@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=fan.yong@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg.drokin@intel.com \
--cc=tao.peng@emc.com \
--cc=yawei.niu@intel.com \
/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®