5ca3faa4dca0eeed6252c5393010a315bbb66578
[oweals/openwrt.git] /
1 From 40e3b847bff70edc28c5290d209e531da6f9e534 Mon Sep 17 00:00:00 2001
2 From: Christian Lamparter <chunkeey@googlemail.com>
3 Date: Fri, 25 Aug 2017 15:47:23 +0200
4 Subject: [PATCH 10/25] crypto: crypto4xx - replace crypto4xx_dev's
5  scatter_buffer_size with constant
6
7 scatter_buffer_size is always set to PPC4XX_SD_BUFFER_SIZE.
8 I don't think there's any point in keeping the variable
9 around.
10
11 Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
12 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
13 ---
14  drivers/crypto/amcc/crypto4xx_core.c | 7 +++----
15  drivers/crypto/amcc/crypto4xx_core.h | 1 -
16  2 files changed, 3 insertions(+), 5 deletions(-)
17
18 --- a/drivers/crypto/amcc/crypto4xx_core.c
19 +++ b/drivers/crypto/amcc/crypto4xx_core.c
20 @@ -396,10 +396,9 @@ static u32 crypto4xx_build_sdr(struct cr
21         if (!dev->sdr)
22                 return -ENOMEM;
23  
24 -       dev->scatter_buffer_size = PPC4XX_SD_BUFFER_SIZE;
25         dev->scatter_buffer_va =
26                 dma_alloc_coherent(dev->core_dev->device,
27 -                       dev->scatter_buffer_size * PPC4XX_NUM_SD,
28 +                       PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD,
29                         &dev->scatter_buffer_pa, GFP_ATOMIC);
30         if (!dev->scatter_buffer_va) {
31                 dma_free_coherent(dev->core_dev->device,
32 @@ -412,7 +411,7 @@ static u32 crypto4xx_build_sdr(struct cr
33  
34         for (i = 0; i < PPC4XX_NUM_SD; i++) {
35                 sd_array[i].ptr = dev->scatter_buffer_pa +
36 -                                 dev->scatter_buffer_size * i;
37 +                                 PPC4XX_SD_BUFFER_SIZE * i;
38         }
39  
40         return 0;
41 @@ -427,7 +426,7 @@ static void crypto4xx_destroy_sdr(struct
42  
43         if (dev->scatter_buffer_va)
44                 dma_free_coherent(dev->core_dev->device,
45 -                                 dev->scatter_buffer_size * PPC4XX_NUM_SD,
46 +                                 PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD,
47                                   dev->scatter_buffer_va,
48                                   dev->scatter_buffer_pa);
49  }
50 --- a/drivers/crypto/amcc/crypto4xx_core.h
51 +++ b/drivers/crypto/amcc/crypto4xx_core.h
52 @@ -87,7 +87,6 @@ struct crypto4xx_device {
53                                         program ce sdr_base_register */
54         void *scatter_buffer_va;
55         dma_addr_t scatter_buffer_pa;
56 -       u32 scatter_buffer_size;
57  
58         void *shadow_sa_pool;           /* pool of memory for sa in pd_uinfo */
59         dma_addr_t shadow_sa_pool_pa;