Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp257538rwb; Thu, 11 Aug 2022 00:28:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR4GQhPvKLua45sLpa0JpcinI7FeyRjp5caeOLTXuB7h8hNhouvZGWfLaALxWeDFBZ6JWOSt X-Received: by 2002:a17:902:ecc8:b0:16f:9355:c103 with SMTP id a8-20020a170902ecc800b0016f9355c103mr27677928plh.122.1660202916514; Thu, 11 Aug 2022 00:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660202916; cv=none; d=google.com; s=arc-20160816; b=ZnG4hxP2nJi5HK1CxJjr0h1VJ0n5M8qjG+pT7t43mwiefgT0r21dIa34I/DD+pKaOV JWzwfiN7UE+jOdZh9CjYer99EXH0j61kRrsVYw0GJWaSymsgiVxWNPve081n7FyEFgm9 F1XqWJ7IyayUsqFWu7REM9KestKWWLfH5aLULFq4VEbJazYpAVVu45UNExBd8G61BjW7 FAPPlF9jNynflqLcpJPnwuiRbfakyS0Q7tc6RkaCg+Liou2D8+F6mGNhhfyOQjp5ELml z8iN6EQkYj9/dh0Pzbz4GvmHTSp/A0OONeSt/SZTCx1sxxzVKUFehIR7iRyw1vA94PZt Q2lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=WXONryOyflopegy3XDOL2p+m/GY7iY/yRXbSRjYd79s=; b=pJXssUS9qyaSVTE7daZCrBKSxACLYrOJwArxKEQ5qylU8+E57yg7UbKFBMrJWuxX0v kzxPgn1+HJ5SCPql+m41Hxifancq+U10MoNgKoGsVboIvc7NsFwAfP3c5ku2MfeUDfHi fuWZ5sggxF02oKOBbc0+Cn8VR/mTljVSuRbVcPmPQouFgD+A9yX1mHY21OBU6D9lNMv1 a2BYX6qnqR3uKFs9lbrZCYuLQ0WynrNBIRQgmHvtA9CEgM7PzrgEjWQiLnFiNlZ4quHP R2fP2CmkbpiWZ2lFmF6Dl1qi2i78UJ7MWqu5bOb+660jtSgqQ+aHp/F8AS7K7oxV3mJ6 cogw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a63ee11000000b0041aff05a86esi18502881pgi.593.2022.08.11.00.28.21; Thu, 11 Aug 2022 00:28:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234323AbiHKHRr (ORCPT + 99 others); Thu, 11 Aug 2022 03:17:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233983AbiHKHRq (ORCPT ); Thu, 11 Aug 2022 03:17:46 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 42F3891D1D; Thu, 11 Aug 2022 00:17:45 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id E64251E80D77; Thu, 11 Aug 2022 15:15:42 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id stz8ltOgymNM; Thu, 11 Aug 2022 15:15:40 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: chuanjian@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id C05001E80D32; Thu, 11 Aug 2022 15:15:39 +0800 (CST) From: Dong Chuanjian To: ebiggers@kernel.org Cc: chuanjian@nfschina.com, davem@davemloft.net, herbert@gondor.apana.org.au, kernel@nfschina.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto/drbg: remove unnecessary (void*) conversions Date: Thu, 11 Aug 2022 15:17:33 +0800 Message-Id: <20220811071733.5145-2-chuanjian@nfschina.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220811071733.5145-1-chuanjian@nfschina.com> References: <20220811071733.5145-1-chuanjian@nfschina.com> X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org remove unnecessary void* type casting v2: Turn assignments less than 75 characters into one line. Signed-off-by: Dong Chuanjian diff --git a/crypto/drbg.c b/crypto/drbg.c index 177983b6ae38..982d4ca4526d 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -1703,7 +1703,7 @@ static int drbg_init_hash_kernel(struct drbg_state *drbg) static int drbg_fini_hash_kernel(struct drbg_state *drbg) { - struct sdesc *sdesc = (struct sdesc *)drbg->priv_data; + struct sdesc *sdesc = drbg->priv_data; if (sdesc) { crypto_free_shash(sdesc->shash.tfm); kfree_sensitive(sdesc); @@ -1715,7 +1715,7 @@ static int drbg_fini_hash_kernel(struct drbg_state *drbg) static void drbg_kcapi_hmacsetkey(struct drbg_state *drbg, const unsigned char *key) { - struct sdesc *sdesc = (struct sdesc *)drbg->priv_data; + struct sdesc *sdesc = drbg->priv_data; crypto_shash_setkey(sdesc->shash.tfm, key, drbg_statelen(drbg)); } @@ -1723,7 +1723,7 @@ static void drbg_kcapi_hmacsetkey(struct drbg_state *drbg, static int drbg_kcapi_hash(struct drbg_state *drbg, unsigned char *outval, const struct list_head *in) { - struct sdesc *sdesc = (struct sdesc *)drbg->priv_data; + struct sdesc *sdesc = drbg->priv_data; struct drbg_string *input = NULL; crypto_shash_init(&sdesc->shash); @@ -1818,8 +1818,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg) static void drbg_kcapi_symsetkey(struct drbg_state *drbg, const unsigned char *key) { - struct crypto_cipher *tfm = - (struct crypto_cipher *)drbg->priv_data; + struct crypto_cipher *tfm = drbg->priv_data; crypto_cipher_setkey(tfm, key, (drbg_keylen(drbg))); } @@ -1827,8 +1826,7 @@ static void drbg_kcapi_symsetkey(struct drbg_state *drbg, static int drbg_kcapi_sym(struct drbg_state *drbg, unsigned char *outval, const struct drbg_string *in) { - struct crypto_cipher *tfm = - (struct crypto_cipher *)drbg->priv_data; + struct crypto_cipher *tfm = drbg->priv_data; /* there is only component in *in */ BUG_ON(in->len < drbg_blocklen(drbg)); -- 2.18.2