Skip to content

Commit aedf818

Browse files
yuzhenfschinaherbertx
authored andcommitted
crypto: drivers - remove unnecessary (void*) conversions
Pointer variables of void * type do not require type cast. Signed-off-by: Yu Zhe <yuzhe@nfschina.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 6f15b1c commit aedf818

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

drivers/crypto/hifn_795x.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ static int hifn_enable_crypto(struct hifn_device *dev)
879879

880880
static void hifn_init_dma(struct hifn_device *dev)
881881
{
882-
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
882+
struct hifn_dma *dma = dev->desc_virt;
883883
u32 dptr = dev->desc_dma;
884884
int i;
885885

@@ -1072,7 +1072,7 @@ static int hifn_setup_crypto_command(struct hifn_device *dev,
10721072
u8 *buf, unsigned dlen, unsigned slen,
10731073
u8 *key, int keylen, u8 *iv, int ivsize, u16 mode)
10741074
{
1075-
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
1075+
struct hifn_dma *dma = dev->desc_virt;
10761076
struct hifn_crypt_command *cry_cmd;
10771077
u8 *buf_pos = buf;
10781078
u16 cmd_len;
@@ -1113,7 +1113,7 @@ static int hifn_setup_cmd_desc(struct hifn_device *dev,
11131113
struct hifn_context *ctx, struct hifn_request_context *rctx,
11141114
void *priv, unsigned int nbytes)
11151115
{
1116-
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
1116+
struct hifn_dma *dma = dev->desc_virt;
11171117
int cmd_len, sa_idx;
11181118
u8 *buf, *buf_pos;
11191119
u16 mask;
@@ -1231,7 +1231,7 @@ static int hifn_setup_cmd_desc(struct hifn_device *dev,
12311231
static int hifn_setup_src_desc(struct hifn_device *dev, struct page *page,
12321232
unsigned int offset, unsigned int size, int last)
12331233
{
1234-
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
1234+
struct hifn_dma *dma = dev->desc_virt;
12351235
int idx;
12361236
dma_addr_t addr;
12371237

@@ -1264,7 +1264,7 @@ static int hifn_setup_src_desc(struct hifn_device *dev, struct page *page,
12641264

12651265
static void hifn_setup_res_desc(struct hifn_device *dev)
12661266
{
1267-
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
1267+
struct hifn_dma *dma = dev->desc_virt;
12681268

12691269
dma->resr[dma->resi].l = __cpu_to_le32(HIFN_USED_RESULT |
12701270
HIFN_D_VALID | HIFN_D_LAST);
@@ -1290,7 +1290,7 @@ static void hifn_setup_res_desc(struct hifn_device *dev)
12901290
static void hifn_setup_dst_desc(struct hifn_device *dev, struct page *page,
12911291
unsigned offset, unsigned size, int last)
12921292
{
1293-
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
1293+
struct hifn_dma *dma = dev->desc_virt;
12941294
int idx;
12951295
dma_addr_t addr;
12961296

@@ -1710,7 +1710,7 @@ static void hifn_process_ready(struct skcipher_request *req, int error)
17101710

17111711
static void hifn_clear_rings(struct hifn_device *dev, int error)
17121712
{
1713-
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
1713+
struct hifn_dma *dma = dev->desc_virt;
17141714
int i, u;
17151715

17161716
dev_dbg(&dev->pdev->dev, "ring cleanup 1: i: %d.%d.%d.%d, u: %d.%d.%d.%d, "
@@ -1784,7 +1784,7 @@ static void hifn_work(struct work_struct *work)
17841784

17851785
spin_lock_irqsave(&dev->lock, flags);
17861786
if (dev->active == 0) {
1787-
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
1787+
struct hifn_dma *dma = dev->desc_virt;
17881788

17891789
if (dma->cmdu == 0 && (dev->flags & HIFN_FLAG_CMD_BUSY)) {
17901790
dev->flags &= ~HIFN_FLAG_CMD_BUSY;
@@ -1815,7 +1815,7 @@ static void hifn_work(struct work_struct *work)
18151815
if (reset) {
18161816
if (++dev->reset >= 5) {
18171817
int i;
1818-
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
1818+
struct hifn_dma *dma = dev->desc_virt;
18191819

18201820
dev_info(&dev->pdev->dev,
18211821
"r: %08x, active: %d, started: %d, "
@@ -1848,8 +1848,8 @@ static void hifn_work(struct work_struct *work)
18481848

18491849
static irqreturn_t hifn_interrupt(int irq, void *data)
18501850
{
1851-
struct hifn_device *dev = (struct hifn_device *)data;
1852-
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
1851+
struct hifn_device *dev = data;
1852+
struct hifn_dma *dma = dev->desc_virt;
18531853
u32 dmacsr, restart;
18541854

18551855
dmacsr = hifn_read_1(dev, HIFN_1_DMA_CSR);
@@ -1914,7 +1914,7 @@ static void hifn_flush(struct hifn_device *dev)
19141914
unsigned long flags;
19151915
struct crypto_async_request *async_req;
19161916
struct skcipher_request *req;
1917-
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
1917+
struct hifn_dma *dma = dev->desc_virt;
19181918
int i;
19191919

19201920
for (i = 0; i < HIFN_D_RES_RSIZE; ++i) {

drivers/crypto/img-hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static int img_hash_xmit_cpu(struct img_hash_dev *hdev, const u8 *buf,
209209

210210
static void img_hash_dma_callback(void *data)
211211
{
212-
struct img_hash_dev *hdev = (struct img_hash_dev *)data;
212+
struct img_hash_dev *hdev = data;
213213
struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req);
214214

215215
if (ctx->bufcnt) {

drivers/crypto/sa2ul.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ static void sa_free_sa_rx_data(struct sa_rx_data *rxd)
10371037

10381038
static void sa_aes_dma_in_callback(void *data)
10391039
{
1040-
struct sa_rx_data *rxd = (struct sa_rx_data *)data;
1040+
struct sa_rx_data *rxd = data;
10411041
struct skcipher_request *req;
10421042
u32 *result;
10431043
__be32 *mdptr;
@@ -1351,7 +1351,7 @@ static int sa_decrypt(struct skcipher_request *req)
13511351

13521352
static void sa_sha_dma_in_callback(void *data)
13531353
{
1354-
struct sa_rx_data *rxd = (struct sa_rx_data *)data;
1354+
struct sa_rx_data *rxd = data;
13551355
struct ahash_request *req;
13561356
struct crypto_ahash *tfm;
13571357
unsigned int authsize;
@@ -1689,7 +1689,7 @@ static void sa_sha_cra_exit(struct crypto_tfm *tfm)
16891689

16901690
static void sa_aead_dma_in_callback(void *data)
16911691
{
1692-
struct sa_rx_data *rxd = (struct sa_rx_data *)data;
1692+
struct sa_rx_data *rxd = data;
16931693
struct aead_request *req;
16941694
struct crypto_aead *tfm;
16951695
unsigned int start;

drivers/crypto/sahara.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ static int sahara_sha_process(struct ahash_request *req)
10351035

10361036
static int sahara_queue_manage(void *data)
10371037
{
1038-
struct sahara_dev *dev = (struct sahara_dev *)data;
1038+
struct sahara_dev *dev = data;
10391039
struct crypto_async_request *async_req;
10401040
struct crypto_async_request *backlog;
10411041
int ret = 0;
@@ -1270,7 +1270,7 @@ static struct ahash_alg sha_v4_algs[] = {
12701270

12711271
static irqreturn_t sahara_irq_handler(int irq, void *data)
12721272
{
1273-
struct sahara_dev *dev = (struct sahara_dev *)data;
1273+
struct sahara_dev *dev = data;
12741274
unsigned int stat = sahara_read(dev, SAHARA_REG_STATUS);
12751275
unsigned int err = sahara_read(dev, SAHARA_REG_ERRSTATUS);
12761276

0 commit comments

Comments
 (0)