netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 net-next] sunrpc: use sg_init_one() in krb5_rc4_setup_enc/seq_key()
@ 2015-06-16 19:57 Fabian Frederick
  2015-06-19 19:52 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2015-06-16 19:57 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Fabian Frederick, Trond Myklebust, Anna Schumaker,
	J. Bruce Fields, David S. Miller,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA

Don't opencode sg_init_one()

Signed-off-by: Fabian Frederick <fabf-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
---
 net/sunrpc/auth_gss/gss_krb5_crypto.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
index b5408e8..fee3c15 100644
--- a/net/sunrpc/auth_gss/gss_krb5_crypto.c
+++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c
@@ -881,9 +881,7 @@ krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, struct crypto_blkcipher *cipher,
 	if (err)
 		goto out_err;
 
-	sg_init_table(sg, 1);
-	sg_set_buf(sg, &zeroconstant, 4);
-
+	sg_init_one(sg, &zeroconstant, 4);
 	err = crypto_hash_digest(&desc, sg, 4, Kseq);
 	if (err)
 		goto out_err;
@@ -951,9 +949,7 @@ krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, struct crypto_blkcipher *cipher,
 	if (err)
 		goto out_err;
 
-	sg_init_table(sg, 1);
-	sg_set_buf(sg, zeroconstant, 4);
-
+	sg_init_one(sg, zeroconstant, 4);
 	err = crypto_hash_digest(&desc, sg, 4, Kcrypt);
 	if (err)
 		goto out_err;
-- 
2.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1 net-next] sunrpc: use sg_init_one() in krb5_rc4_setup_enc/seq_key()
  2015-06-16 19:57 [PATCH 1/1 net-next] sunrpc: use sg_init_one() in krb5_rc4_setup_enc/seq_key() Fabian Frederick
@ 2015-06-19 19:52 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2015-06-19 19:52 UTC (permalink / raw)
  To: Fabian Frederick
  Cc: linux-kernel, Trond Myklebust, Anna Schumaker, David S. Miller,
	linux-nfs, netdev

Thanks, applying.--b.

On Tue, Jun 16, 2015 at 09:57:52PM +0200, Fabian Frederick wrote:
> Don't opencode sg_init_one()
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  net/sunrpc/auth_gss/gss_krb5_crypto.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
> index b5408e8..fee3c15 100644
> --- a/net/sunrpc/auth_gss/gss_krb5_crypto.c
> +++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c
> @@ -881,9 +881,7 @@ krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, struct crypto_blkcipher *cipher,
>  	if (err)
>  		goto out_err;
>  
> -	sg_init_table(sg, 1);
> -	sg_set_buf(sg, &zeroconstant, 4);
> -
> +	sg_init_one(sg, &zeroconstant, 4);
>  	err = crypto_hash_digest(&desc, sg, 4, Kseq);
>  	if (err)
>  		goto out_err;
> @@ -951,9 +949,7 @@ krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, struct crypto_blkcipher *cipher,
>  	if (err)
>  		goto out_err;
>  
> -	sg_init_table(sg, 1);
> -	sg_set_buf(sg, zeroconstant, 4);
> -
> +	sg_init_one(sg, zeroconstant, 4);
>  	err = crypto_hash_digest(&desc, sg, 4, Kcrypt);
>  	if (err)
>  		goto out_err;
> -- 
> 2.4.2

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-19 19:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-16 19:57 [PATCH 1/1 net-next] sunrpc: use sg_init_one() in krb5_rc4_setup_enc/seq_key() Fabian Frederick
2015-06-19 19:52 ` J. Bruce Fields

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).