Commit 5318c53d authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Herbert Xu

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: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 4f8de65b
...@@ -155,43 +155,43 @@ ...@@ -155,43 +155,43 @@
* expansion of its usage. * expansion of its usage.
*/ */
struct samsung_aes_variant { struct samsung_aes_variant {
unsigned int aes_offset; unsigned int aes_offset;
}; };
struct s5p_aes_reqctx { struct s5p_aes_reqctx {
unsigned long mode; unsigned long mode;
}; };
struct s5p_aes_ctx { struct s5p_aes_ctx {
struct s5p_aes_dev *dev; struct s5p_aes_dev *dev;
uint8_t aes_key[AES_MAX_KEY_SIZE]; uint8_t aes_key[AES_MAX_KEY_SIZE];
uint8_t nonce[CTR_RFC3686_NONCE_SIZE]; uint8_t nonce[CTR_RFC3686_NONCE_SIZE];
int keylen; int keylen;
}; };
struct s5p_aes_dev { struct s5p_aes_dev {
struct device *dev; struct device *dev;
struct clk *clk; struct clk *clk;
void __iomem *ioaddr; void __iomem *ioaddr;
void __iomem *aes_ioaddr; void __iomem *aes_ioaddr;
int irq_fc; int irq_fc;
struct ablkcipher_request *req; struct ablkcipher_request *req;
struct s5p_aes_ctx *ctx; struct s5p_aes_ctx *ctx;
struct scatterlist *sg_src; struct scatterlist *sg_src;
struct scatterlist *sg_dst; struct scatterlist *sg_dst;
/* In case of unaligned access: */ /* In case of unaligned access: */
struct scatterlist *sg_src_cpy; struct scatterlist *sg_src_cpy;
struct scatterlist *sg_dst_cpy; struct scatterlist *sg_dst_cpy;
struct tasklet_struct tasklet; struct tasklet_struct tasklet;
struct crypto_queue queue; struct crypto_queue queue;
bool busy; bool busy;
spinlock_t lock; spinlock_t lock;
struct samsung_aes_variant *variant; struct samsung_aes_variant *variant;
}; };
static struct s5p_aes_dev *s5p_dev; static struct s5p_aes_dev *s5p_dev;
...@@ -421,11 +421,11 @@ static bool s5p_aes_rx(struct s5p_aes_dev *dev) ...@@ -421,11 +421,11 @@ static bool s5p_aes_rx(struct s5p_aes_dev *dev)
static irqreturn_t s5p_aes_interrupt(int irq, void *dev_id) static irqreturn_t s5p_aes_interrupt(int irq, void *dev_id)
{ {
struct platform_device *pdev = dev_id; struct platform_device *pdev = dev_id;
struct s5p_aes_dev *dev = platform_get_drvdata(pdev); struct s5p_aes_dev *dev = platform_get_drvdata(pdev);
uint32_t status; bool set_dma_tx = false;
unsigned long flags; bool set_dma_rx = false;
bool set_dma_tx = false; unsigned long flags;
bool set_dma_rx = false; uint32_t status;
spin_lock_irqsave(&dev->lock, flags); spin_lock_irqsave(&dev->lock, flags);
...@@ -538,10 +538,10 @@ static int s5p_set_outdata_start(struct s5p_aes_dev *dev, ...@@ -538,10 +538,10 @@ static int s5p_set_outdata_start(struct s5p_aes_dev *dev,
static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode) static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode)
{ {
struct ablkcipher_request *req = dev->req; struct ablkcipher_request *req = dev->req;
uint32_t aes_control; uint32_t aes_control;
int err; unsigned long flags;
unsigned long flags; int err;
aes_control = SSS_AES_KEY_CHANGE_MODE; aes_control = SSS_AES_KEY_CHANGE_MODE;
if (mode & FLAGS_AES_DECRYPT) if (mode & FLAGS_AES_DECRYPT)
...@@ -653,10 +653,10 @@ static int s5p_aes_handle_req(struct s5p_aes_dev *dev, ...@@ -653,10 +653,10 @@ static int s5p_aes_handle_req(struct s5p_aes_dev *dev,
static int s5p_aes_crypt(struct ablkcipher_request *req, unsigned long mode) static int s5p_aes_crypt(struct ablkcipher_request *req, unsigned long mode)
{ {
struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
struct s5p_aes_ctx *ctx = crypto_ablkcipher_ctx(tfm); struct s5p_aes_reqctx *reqctx = ablkcipher_request_ctx(req);
struct s5p_aes_reqctx *reqctx = ablkcipher_request_ctx(req); struct s5p_aes_ctx *ctx = crypto_ablkcipher_ctx(tfm);
struct s5p_aes_dev *dev = ctx->dev; struct s5p_aes_dev *dev = ctx->dev;
if (!IS_ALIGNED(req->nbytes, AES_BLOCK_SIZE)) { if (!IS_ALIGNED(req->nbytes, AES_BLOCK_SIZE)) {
dev_err(dev->dev, "request size is not exact amount of AES blocks\n"); 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) ...@@ -671,7 +671,7 @@ static int s5p_aes_crypt(struct ablkcipher_request *req, unsigned long mode)
static int s5p_aes_setkey(struct crypto_ablkcipher *cipher, static int s5p_aes_setkey(struct crypto_ablkcipher *cipher,
const uint8_t *key, unsigned int keylen) const uint8_t *key, unsigned int keylen)
{ {
struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher); struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher);
struct s5p_aes_ctx *ctx = crypto_tfm_ctx(tfm); struct s5p_aes_ctx *ctx = crypto_tfm_ctx(tfm);
if (keylen != AES_KEYSIZE_128 && if (keylen != AES_KEYSIZE_128 &&
...@@ -763,11 +763,11 @@ static struct crypto_alg algs[] = { ...@@ -763,11 +763,11 @@ static struct crypto_alg algs[] = {
static int s5p_aes_probe(struct platform_device *pdev) static int s5p_aes_probe(struct platform_device *pdev)
{ {
int i, j, err = -ENODEV; struct device *dev = &pdev->dev;
struct s5p_aes_dev *pdata; int i, j, err = -ENODEV;
struct device *dev = &pdev->dev;
struct resource *res;
struct samsung_aes_variant *variant; struct samsung_aes_variant *variant;
struct s5p_aes_dev *pdata;
struct resource *res;
if (s5p_dev) if (s5p_dev)
return -EEXIST; return -EEXIST;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment