public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Meyer <thomas@m3y3r.de>
To: linux-scsi@vger.kernel.org
Subject: TARGET: Use ERR_CAST inlined function
Date: Mon, 01 Aug 2011 23:58:18 +0200	[thread overview]
Message-ID: <1312235902.2629.4.camel@localhost.localdomain> (raw)

 Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))

 The semantic patch that makes this output is available
 in scripts/coccinelle/api/err_cast.cocci.

 More information about semantic patching is available at
 http://coccinelle.lip6.fr/

diff -u -p a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c
--- a/drivers/target/target_core_fabric_configfs.c 2011-07-26 00:46:09.670171895 +0200
+++ b/drivers/target/target_core_fabric_configfs.c 2011-08-01 20:49:50.880256441 +0200
@@ -481,7 +481,7 @@ static struct config_group *target_fabri
 
 	se_nacl = tf->tf_ops.fabric_make_nodeacl(se_tpg, group, name);
 	if (IS_ERR(se_nacl))
-		return ERR_PTR(PTR_ERR(se_nacl));
+		return ERR_CAST(se_nacl);
 
 	nacl_cg = &se_nacl->acl_group;
 	nacl_cg->default_groups = se_nacl->acl_default_groups;
diff -u -p a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c
--- a/drivers/target/iscsi/iscsi_target_configfs.c 2011-07-28 15:32:18.326584569 +0200
+++ b/drivers/target/iscsi/iscsi_target_configfs.c 2011-08-01 20:49:55.393565325 +0200
@@ -268,7 +268,7 @@ struct se_tpg_np *lio_target_call_addnpt
 				ISCSI_TCP);
 	if (IS_ERR(tpg_np)) {
 		iscsit_put_tpg(tpg);
-		return ERR_PTR(PTR_ERR(tpg_np));
+		return ERR_CAST(tpg_np);
 	}
 	pr_debug("LIO_Target_ConfigFS: addnptotpg done!\n");
 
@@ -1285,7 +1285,7 @@ struct se_wwn *lio_target_call_coreaddti
 
 	tiqn = iscsit_add_tiqn((unsigned char *)name);
 	if (IS_ERR(tiqn))
-		return ERR_PTR(PTR_ERR(tiqn));
+		return ERR_CAST(tiqn);
 	/*
 	 * Setup struct iscsi_wwn_stat_grps for se_wwn->fabric_stat_group.
 	 */



             reply	other threads:[~2011-08-01 22:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01 21:58 Thomas Meyer [this message]
2011-08-04 18:00 ` TARGET: Use ERR_CAST inlined function Nicholas A. Bellinger
2011-08-04 20:38   ` Thomas Meyer

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=1312235902.2629.4.camel@localhost.localdomain \
    --to=thomas@m3y3r.de \
    --cc=linux-scsi@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