Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp370242imm; Thu, 13 Sep 2018 00:59:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZcG/kOXh6fTD1W0tGQTDV9TJj1ULb5T+aeT61dMM65/wj03ARh1gHDQOoyEqZEn46ySqHk X-Received: by 2002:a63:e318:: with SMTP id f24-v6mr5874858pgh.175.1536825567994; Thu, 13 Sep 2018 00:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536825567; cv=none; d=google.com; s=arc-20160816; b=yWRE9naQcDJWB7gtItFczIataTfvrfkOxf9clkpU/vJYx7PXeP6HzuVB3Bqsf+SvNP 3jy1jVTeUvCGCkDJCcMIV4w5g37lGNkLb9YjNAcIO+73G0trkB1wJ2eDGFrjQIUR6sHr sCC8tCZacTEsZiFDEpFYSUfJwkW/rMpvlvG5a3E7ot0f5Gwl2caq0NfG5xlxZ+2M5/M6 Ezh5P1sLhBK95NAwVrznENdkuVPaPP7Q1OVYnydBk/3n/sZA3NC6oULvI7vOMXEy+ktV 6EVBJUxrJ6mZ55V05rF6nOGhvdQQRu6i8HDRcuzUWZrxRLZ8aynngiMFehKdJLhKGd+k WvLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id :in-reply-to:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=l9dzKZhZyTX907wXIXPg0iGCADhosQ5oYevz4OylNyk=; b=HwOcFcsApwdjOQmDHRnWILOoDLwL0BLCvcqHw67ovMBvWDT/NwxIb8pzwKv3VI0fhV ss6SxDTGnZxFZD6GSd45l+cwkRQhAyBr/Zqjrah6b/XD5z0gcrorXhDnBxad88tYVvdj Gc+tvn8cGWnh5NHMyVrRmiXqrmoMDM0sP1F5JSpTXmR1JkZBLKP6f3/+Hu0TrpXkDLCA G+TAxPNRC3kcemXHCDfsbX39cyBTg/DnhX4Q3etedc7ilKcQoFIGYXm01GyMrbFDb1WD h2cyYTZACi6eEtF0PrNWRRqwPwhAEnglzQ/HdBQAkE8oP+LQcM9My6hOnro3RBhOA2WH tMFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=PYrygLqK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y4-v6si3550640pgh.225.2018.09.13.00.59.11; Thu, 13 Sep 2018 00:59:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=PYrygLqK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727807AbeIMNHW (ORCPT + 99 others); Thu, 13 Sep 2018 09:07:22 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:46167 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727788AbeIMNHV (ORCPT ); Thu, 13 Sep 2018 09:07:21 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180913075901euoutp025705dbc7c646f1b13af1bfc9347f87f9~T5q-57VwZ1584915849euoutp02W for ; Thu, 13 Sep 2018 07:59:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180913075901euoutp025705dbc7c646f1b13af1bfc9347f87f9~T5q-57VwZ1584915849euoutp02W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1536825541; bh=l9dzKZhZyTX907wXIXPg0iGCADhosQ5oYevz4OylNyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PYrygLqKPiFjuywSNiMgrQGytgvkljYfQEwN/cF6Z6RILVj7oXD4F4OxgIt/ol1MR eHuYueoy9eDkW7OT7943F3mWYi6YZFKLl3yS/M/APL51I+QpyaSILkoFO9VBUd646z LO3m2tTaXI0J1BzV6NAeuFZUMClLa3/U411Erhzw= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180913075900eucas1p2c648e0d9b35b48e55769366cc6cf7bc4~T5q-Wi0g41220012200eucas1p2L; Thu, 13 Sep 2018 07:59:00 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 3D.D7.04294.4C81A9B5; Thu, 13 Sep 2018 08:59:00 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20180913075859eucas1p2bba2f5ab32fea5c4f832abaacaed6c8b~T5q_dx0q42420924209eucas1p2D; Thu, 13 Sep 2018 07:58:59 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20180913075859eusmtrp2daf71033d70b7e1f154b07597dda9f16~T5q_Mf-6D2501625016eusmtrp2K; Thu, 13 Sep 2018 07:58:59 +0000 (GMT) X-AuditID: cbfec7f4-835ff700000010c6-8b-5b9a18c4891d Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 3C.9A.04284.3C81A9B5; Thu, 13 Sep 2018 08:58:59 +0100 (BST) Received: from AMDC2034.DIGITAL.local (unknown [106.120.51.41]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180913075859eusmtip1efab34492c378462c29ec6426d2daba0~T5q9vmtMT1717917179eusmtip1p; Thu, 13 Sep 2018 07:58:58 +0000 (GMT) From: Christoph Manszewski To: linux-crypto@vger.kernel.org Cc: Christoph Manszewski , Krzysztof Kozlowski , Vladimir Zapolskiy , Kamil Konieczny , Herbert Xu , "David S. Miller" , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] crypto: s5p-sss: Minor code cleanup Date: Thu, 13 Sep 2018 09:58:41 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536825522-6027-1-git-send-email-c.manszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjleLIzCtJLcpLzFFi42LZduznOd0jErOiDZ7PELM4vnspo8Wc8y0s Ft2vZCz69v1ntDh/fgO7xf17P5ksLu+aw2Yx4/w+Jov/v5qZHTg9tqy8yeSx7YCqx6ZVnWwe /xZOYfE4+G4Pk0ffllWMHp83yQWwR3HZpKTmZJalFunbJXBlNN94zljQIl0xYV4TUwPjGtEu Rk4OCQETib7GtWxdjFwcQgIrGCVOb7rGDOF8YZSYv2M1K4TzmVFi64pjzDAtd1f+h6pazigx tek/K1zLl3edrCBVbAKmErfvfgIazMEhIqAgMe+rDkgNs8AZJomLE+aCTRIWsJBof9TIAmKz CKhK9EzYyAqxQU7i5rlOZpBeTgEPidPb3EF6JQS62SX6vn8Bq+cVKJPYcWcGC0S9i8SkxfOZ IGxhiVfHt7BD2DIS/3eCxEGamxklbn25xgrhTGCUOLi6C6rbWmLTjVdMINuYBTQl1u/Shwg7 Srx6vx7sAQkBPokbbwVBwsxA5qRt05khwrwSHW1CENVqEq+3bGGDWfvi81dGCNtD4uPZldDA ms0oMX3nc5YJjPKzEJYtYGRcxSieWlqcm55abJSXWq5XnJhbXJqXrpecn7uJEZhKTv87/mUH 464/SYcYBTgYlXh4Z6jPjBZiTSwrrsw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tUsTitXDF639soux2Xtm/bJXPdaX6VEktxRqKhFnNRcSIA6mH3gYECAAA= Message-Id: <20180913075859eucas1p2bba2f5ab32fea5c4f832abaacaed6c8b~T5q_dx0q42420924209eucas1p2D@eucas1p2.samsung.com> X-CMS-MailID: 20180913075859eucas1p2bba2f5ab32fea5c4f832abaacaed6c8b X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20180913075859eucas1p2bba2f5ab32fea5c4f832abaacaed6c8b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180913075859eucas1p2bba2f5ab32fea5c4f832abaacaed6c8b References: <1536825522-6027-1-git-send-email-c.manszewski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Modifications in s5p-sss.c: - remove unnecessary 'goto' statements, - change uint_8 and uint_32 to u8 and u32 types, Signed-off-by: Christoph Manszewski --- drivers/crypto/s5p-sss.c | 54 +++++++++++++++--------------------------------- 1 file changed, 17 insertions(+), 37 deletions(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index ce9bd13ea166..817a4b2b71e6 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -249,8 +249,8 @@ struct s5p_aes_reqctx { struct s5p_aes_ctx { struct s5p_aes_dev *dev; - uint8_t aes_key[AES_MAX_KEY_SIZE]; - uint8_t nonce[CTR_RFC3686_NONCE_SIZE]; + u8 aes_key[AES_MAX_KEY_SIZE]; + u8 nonce[CTR_RFC3686_NONCE_SIZE]; int keylen; }; @@ -518,46 +518,28 @@ static int s5p_make_sg_cpy(struct s5p_aes_dev *dev, struct scatterlist *src, static int s5p_set_outdata(struct s5p_aes_dev *dev, struct scatterlist *sg) { - int err; - - if (!sg->length) { - err = -EINVAL; - goto exit; - } + if (!sg->length) + return -EINVAL; - err = dma_map_sg(dev->dev, sg, 1, DMA_FROM_DEVICE); - if (!err) { - err = -ENOMEM; - goto exit; - } + if (!dma_map_sg(dev->dev, sg, 1, DMA_FROM_DEVICE)) + return -ENOMEM; dev->sg_dst = sg; - err = 0; -exit: - return err; + return 0; } static int s5p_set_indata(struct s5p_aes_dev *dev, struct scatterlist *sg) { - int err; - - if (!sg->length) { - err = -EINVAL; - goto exit; - } + if (!sg->length) + return -EINVAL; - err = dma_map_sg(dev->dev, sg, 1, DMA_TO_DEVICE); - if (!err) { - err = -ENOMEM; - goto exit; - } + if (!dma_map_sg(dev->dev, sg, 1, DMA_TO_DEVICE)) + return -ENOMEM; dev->sg_src = sg; - err = 0; -exit: - return err; + return 0; } /* @@ -662,8 +644,7 @@ static irqreturn_t s5p_aes_interrupt(int irq, void *dev_id) bool tx_end = false; bool hx_end = false; unsigned long flags; - uint32_t status; - u32 st_bits; + u32 status, st_bits; int err; spin_lock_irqsave(&dev->lock, flags); @@ -1833,7 +1814,7 @@ static struct ahash_alg algs_sha1_md5_sha256[] = { }; static void s5p_set_aes(struct s5p_aes_dev *dev, - const uint8_t *key, const uint8_t *iv, + const u8 *key, const u8 *iv, unsigned int keylen) { void __iomem *keystart; @@ -1919,7 +1900,7 @@ 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) { struct ablkcipher_request *req = dev->req; - uint32_t aes_control; + u32 aes_control; unsigned long flags; int err; u8 *iv; @@ -2027,7 +2008,7 @@ static int s5p_aes_handle_req(struct s5p_aes_dev *dev, err = ablkcipher_enqueue_request(&dev->queue, req); if (dev->busy) { spin_unlock_irqrestore(&dev->lock, flags); - goto exit; + return err; } dev->busy = true; @@ -2035,7 +2016,6 @@ static int s5p_aes_handle_req(struct s5p_aes_dev *dev, tasklet_schedule(&dev->tasklet); -exit: return err; } @@ -2057,7 +2037,7 @@ static int s5p_aes_crypt(struct ablkcipher_request *req, unsigned long mode) } static int s5p_aes_setkey(struct crypto_ablkcipher *cipher, - const uint8_t *key, unsigned int keylen) + const u8 *key, unsigned int keylen) { struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher); struct s5p_aes_ctx *ctx = crypto_tfm_ctx(tfm); -- 2.7.4