--- old/usr/src/uts/common/crypto/io/dca.c	2016-02-10 17:30:49.534988902 -0500
+++ new/usr/src/uts/common/crypto/io/dca.c	2016-02-10 17:30:49.556857486 -0500
@@ -414,12 +414,7 @@
 };
 
 /* Convenience macros */
-/* Retrieve the softc and instance number from a SPI crypto context */
-#define	DCA_SOFTC_FROM_CTX(ctx, softc, instance) {		\
-	(softc) = (dca_t *)(ctx)->cc_provider;			\
-	(instance) = ddi_get_instance((softc)->dca_dip);	\
-}
-
+#define	DCA_SOFTC_FROM_CTX(ctx)	((dca_t *)(ctx)->cc_provider)
 #define	DCA_MECH_FROM_CTX(ctx) \
 	(((dca_request_t *)(ctx)->cc_provider_private)->dr_ctx.ctx_cm_type)
 
@@ -3694,11 +3689,8 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_encrypt_init: started");
 
 	/* check mechanism */
@@ -3737,14 +3729,11 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_encrypt: started");
 
 	/* handle inplace ops */
@@ -3792,14 +3781,11 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_encrypt_update: started");
 
 	/* handle inplace ops */
@@ -3838,14 +3824,11 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_encrypt_final: started");
 
 	/* check mechanism */
@@ -3928,11 +3911,8 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_decrypt_init: started");
 
 	/* check mechanism */
@@ -3971,14 +3951,11 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_decrypt: started");
 
 	/* handle inplace ops */
@@ -4027,14 +4004,11 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_decrypt_update: started");
 
 	/* handle inplace ops */
@@ -4073,14 +4047,11 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_decrypt_final: started");
 
 	/* check mechanism */
@@ -4167,11 +4138,8 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_sign_init: started\n");
 
 	if (ctx_template != NULL)
@@ -4208,14 +4176,11 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_sign: started\n");
 
 	/* check mechanism */
@@ -4245,14 +4210,11 @@
 {
 	int error = CRYPTO_MECHANISM_INVALID;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_sign_update: started\n");
 
 	cmn_err(CE_WARN, "dca_sign_update: unexpected mech type "
@@ -4270,14 +4232,11 @@
 {
 	int error = CRYPTO_MECHANISM_INVALID;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_sign_final: started\n");
 
 	cmn_err(CE_WARN, "dca_sign_final: unexpected mech type "
@@ -4332,11 +4291,8 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_sign_recover_init: started\n");
 
 	if (ctx_template != NULL)
@@ -4369,14 +4325,11 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_sign_recover: started\n");
 
 	/* check mechanism */
@@ -4404,10 +4357,7 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc = (dca_t *)provider;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
-	instance = ddi_get_instance(softc->dca_dip);
 	DBG(softc, DENTRY, "dca_sign_recover_atomic: started\n");
 
 	if (ctx_template != NULL)
@@ -4443,11 +4393,8 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_verify_init: started\n");
 
 	if (ctx_template != NULL)
@@ -4484,14 +4431,11 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_verify: started\n");
 
 	/* check mechanism */
@@ -4521,14 +4465,11 @@
 {
 	int error = CRYPTO_MECHANISM_INVALID;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_verify_update: started\n");
 
 	cmn_err(CE_WARN, "dca_verify_update: unexpected mech type "
@@ -4546,14 +4487,11 @@
 {
 	int error = CRYPTO_MECHANISM_INVALID;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_verify_final: started\n");
 
 	cmn_err(CE_WARN, "dca_verify_final: unexpected mech type "
@@ -4608,11 +4546,8 @@
 {
 	int error = CRYPTO_MECHANISM_INVALID;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_verify_recover_init: started\n");
 
 	if (ctx_template != NULL)
@@ -4644,14 +4579,11 @@
 {
 	int error = CRYPTO_MECHANISM_INVALID;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
 	if (!ctx || !ctx->cc_provider || !ctx->cc_provider_private)
 		return (CRYPTO_OPERATION_NOT_INITIALIZED);
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_verify_recover: started\n");
 
 	/* check mechanism */
@@ -4715,10 +4647,7 @@
 {
 	int error = CRYPTO_FAILED;
 	dca_t *softc = (dca_t *)provider;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
-	instance = ddi_get_instance(softc->dca_dip);
 	DBG(softc, DENTRY, "dca_generate_random: started");
 
 	error = dca_rng(softc, buf, len, req);
@@ -4737,11 +4666,8 @@
 {
 	int error = CRYPTO_SUCCESS;
 	dca_t *softc;
-	/* LINTED E_FUNC_SET_NOT_USED */
-	int instance;
 
-	/* extract softc and instance number from context */
-	DCA_SOFTC_FROM_CTX(ctx, softc, instance);
+	softc = DCA_SOFTC_FROM_CTX(ctx);
 	DBG(softc, DENTRY, "dca_free_context: entered");
 
 	if (ctx->cc_provider_private == NULL)
