aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/s5p-sss.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2016-05-27 07:49:40 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2016-05-31 05:52:30 -0400
commit5318c53d5b4bbf097ccba2e74831d67e4d63b1a1 (patch)
tree678a20ebe1c0381a643cab7cf924ec6a713c4d6b /drivers/crypto/s5p-sss.c
parent4f8de65bab611a68f40355ac9169edb4d0d33974 (diff)
crypto: s5p-sss - Use consistent indentation for variables and members
Bring some consistency by: 1. Replacing fixed-space indentation of structure members with just tabs. 2. Remove indentation in declaration of local variable between type and name. Driver was mixing usage of such indentation and lack of it. When removing indentation, reorder variables in reversed-christmas-tree order with first variables being initialized ones. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/s5p-sss.c')
-rw-r--r--drivers/crypto/s5p-sss.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c
index 2b3a0cfe3331..dce1af0ce85c 100644
--- a/drivers/crypto/s5p-sss.c
+++ b/drivers/crypto/s5p-sss.c
@@ -155,43 +155,43 @@
155 * expansion of its usage. 155 * expansion of its usage.
156 */ 156 */
157struct samsung_aes_variant { 157struct samsung_aes_variant {
158 unsigned int aes_offset; 158 unsigned int aes_offset;
159}; 159};
160 160
161struct s5p_aes_reqctx { 161struct s5p_aes_reqctx {
162 unsigned long mode; 162 unsigned long mode;
163}; 163};
164 164
165struct s5p_aes_ctx { 165struct s5p_aes_ctx {
166 struct s5p_aes_dev *dev; 166 struct s5p_aes_dev *dev;
167 167
168 uint8_t aes_key[AES_MAX_KEY_SIZE]; 168 uint8_t aes_key[AES_MAX_KEY_SIZE];
169 uint8_t nonce[CTR_RFC3686_NONCE_SIZE]; 169 uint8_t nonce[CTR_RFC3686_NONCE_SIZE];
170 int keylen; 170 int keylen;
171}; 171};
172 172
173struct s5p_aes_dev { 173struct s5p_aes_dev {
174 struct device *dev; 174 struct device *dev;
175 struct clk *clk; 175 struct clk *clk;
176 void __iomem *ioaddr; 176 void __iomem *ioaddr;
177 void __iomem *aes_ioaddr; 177 void __iomem *aes_ioaddr;
178 int irq_fc; 178 int irq_fc;
179 179
180 struct ablkcipher_request *req; 180 struct ablkcipher_request *req;
181 struct s5p_aes_ctx *ctx; 181 struct s5p_aes_ctx *ctx;
182 struct scatterlist *sg_src; 182 struct scatterlist *sg_src;
183 struct scatterlist *sg_dst; 183 struct scatterlist *sg_dst;
184 184
185 /* In case of unaligned access: */ 185 /* In case of unaligned access: */
186 struct scatterlist *sg_src_cpy; 186 struct scatterlist *sg_src_cpy;
187 struct scatterlist *sg_dst_cpy; 187 struct scatterlist *sg_dst_cpy;
188 188
189 struct tasklet_struct tasklet; 189 struct tasklet_struct tasklet;
190 struct crypto_queue queue; 190 struct crypto_queue queue;
191 bool busy; 191 bool busy;
192 spinlock_t lock; 192 spinlock_t lock;
193 193
194 struct samsung_aes_variant *variant; 194 struct samsung_aes_variant *variant;
195}; 195};
196 196
197static struct s5p_aes_dev *s5p_dev; 197static struct s5p_aes_dev *s5p_dev;
@@ -421,11 +421,11 @@ static bool s5p_aes_rx(struct s5p_aes_dev *dev)
421static irqreturn_t s5p_aes_interrupt(int irq, void *dev_id) 421static irqreturn_t s5p_aes_interrupt(int irq, void *dev_id)
422{ 422{
423 struct platform_device *pdev = dev_id; 423 struct platform_device *pdev = dev_id;
424 struct s5p_aes_dev *dev = platform_get_drvdata(pdev); 424 struct s5p_aes_dev *dev = platform_get_drvdata(pdev);
425 uint32_t status; 425 bool set_dma_tx = false;
426 unsigned long flags; 426 bool set_dma_rx = false;
427 bool set_dma_tx = false; 427 unsigned long flags;
428 bool set_dma_rx = false; 428 uint32_t status;
429 429
430 spin_lock_irqsave(&dev->lock, flags); 430 spin_lock_irqsave(&dev->lock, flags);
431 431
@@ -538,10 +538,10 @@ static int s5p_set_outdata_start(struct s5p_aes_dev *dev,
538 538
539static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode) 539static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode)
540{ 540{
541 struct ablkcipher_request *req = dev->req; 541 struct ablkcipher_request *req = dev->req;
542 uint32_t aes_control; 542 uint32_t aes_control;
543 int err; 543 unsigned long flags;
544 unsigned long flags; 544 int err;
545 545
546 aes_control = SSS_AES_KEY_CHANGE_MODE; 546 aes_control = SSS_AES_KEY_CHANGE_MODE;
547 if (mode & FLAGS_AES_DECRYPT) 547 if (mode & FLAGS_AES_DECRYPT)
@@ -653,10 +653,10 @@ exit:
653 653
654static int s5p_aes_crypt(struct ablkcipher_request *req, unsigned long mode) 654static int s5p_aes_crypt(struct ablkcipher_request *req, unsigned long mode)
655{ 655{
656 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); 656 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
657 struct s5p_aes_ctx *ctx = crypto_ablkcipher_ctx(tfm); 657 struct s5p_aes_reqctx *reqctx = ablkcipher_request_ctx(req);
658 struct s5p_aes_reqctx *reqctx = ablkcipher_request_ctx(req); 658 struct s5p_aes_ctx *ctx = crypto_ablkcipher_ctx(tfm);
659 struct s5p_aes_dev *dev = ctx->dev; 659 struct s5p_aes_dev *dev = ctx->dev;
660 660
661 if (!IS_ALIGNED(req->nbytes, AES_BLOCK_SIZE)) { 661 if (!IS_ALIGNED(req->nbytes, AES_BLOCK_SIZE)) {
662 dev_err(dev->dev, "request size is not exact amount of AES blocks\n"); 662 dev_err(dev->dev, "request size is not exact amount of AES blocks\n");
@@ -671,7 +671,7 @@ static int s5p_aes_crypt(struct ablkcipher_request *req, unsigned long mode)
671static int s5p_aes_setkey(struct crypto_ablkcipher *cipher, 671static int s5p_aes_setkey(struct crypto_ablkcipher *cipher,
672 const uint8_t *key, unsigned int keylen) 672 const uint8_t *key, unsigned int keylen)
673{ 673{
674 struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher); 674 struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher);
675 struct s5p_aes_ctx *ctx = crypto_tfm_ctx(tfm); 675 struct s5p_aes_ctx *ctx = crypto_tfm_ctx(tfm);
676 676
677 if (keylen != AES_KEYSIZE_128 && 677 if (keylen != AES_KEYSIZE_128 &&
@@ -763,11 +763,11 @@ static struct crypto_alg algs[] = {
763 763
764static int s5p_aes_probe(struct platform_device *pdev) 764static int s5p_aes_probe(struct platform_device *pdev)
765{ 765{
766 int i, j, err = -ENODEV; 766 struct device *dev = &pdev->dev;
767 struct s5p_aes_dev *pdata; 767 int i, j, err = -ENODEV;
768 struct device *dev = &pdev->dev;
769 struct resource *res;
770 struct samsung_aes_variant *variant; 768 struct samsung_aes_variant *variant;
769 struct s5p_aes_dev *pdata;
770 struct resource *res;
771 771
772 if (s5p_dev) 772 if (s5p_dev)
773 return -EEXIST; 773 return -EEXIST;