From patchwork Fri Apr 16 12:23:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12207525 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2711EC433ED for ; Fri, 16 Apr 2021 12:23:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9048611AE for ; Fri, 16 Apr 2021 12:23:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243391AbhDPMXl (ORCPT ); Fri, 16 Apr 2021 08:23:41 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36168 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235577AbhDPMXk (ORCPT ); Fri, 16 Apr 2021 08:23:40 -0400 Received: from mail-ej1-f72.google.com ([209.85.218.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lXNVD-0006mS-Dt for linux-samsung-soc@vger.kernel.org; Fri, 16 Apr 2021 12:23:15 +0000 Received: by mail-ej1-f72.google.com with SMTP id i10-20020a1709067a4ab029037c5dba8400so1963984ejo.8 for ; Fri, 16 Apr 2021 05:23:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=zyiHnszFk290pFE9xQFpSwJqvg0B5IFpzGvGacwtYN4=; b=ZpjpSxw2cMe1wEixYNJfxG5mUrnGHDk8RhhES+O8cKDQbLD34acOhsKlBP1RzGDplJ TxYJesmI+CDLM3LEH5RJ+igsNzL4APIGsfDZu1AqmTFSN/pZZ/Uj9g+VgkUVh3J7zw71 /PVnhhZJ/r6sBwICBU5EJRE+yI1+AkYlGtET2IDPuD4bgKRdqwvOVVF1WPy3IuNp7XI5 okMEszzxZMNSx5f0WXVY0tjZlHZHudQ0sjYqKiMZBOSRY71au2MSQwe5Zhex6q7Ug5ty 6cJMQZuW8siTMVunoPyeq06UNs1lKaDAEX6J7GrWucgY8YxigpWUIuQH10zocuDIgipp Dkqw== X-Gm-Message-State: AOAM530dJI1X9EI/NhIbaDLigNEEEHg3iN2xN0aiXa9bKCTOV2pQILJG JeWF2GmZgrvxbDqbVVz+pzdB4sKreLpMM5eIM5YEEbZc9PLzI7LUCdpMItQsklhL8kwMODvcmew 4PRAt09D9ToOFhQeYQzyHRQckyWmZrSFmsFZFL91vMu7ZD1ay X-Received: by 2002:a17:906:cc88:: with SMTP id oq8mr3697680ejb.66.1618575794966; Fri, 16 Apr 2021 05:23:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3zbjnd4HQkCSJYV28UfiRyMLheJIB6t7IsbXsF8yk+dO9xyseBRuNJFTx+2VFeWEOHhu4hw== X-Received: by 2002:a17:906:cc88:: with SMTP id oq8mr3697662ejb.66.1618575794849; Fri, 16 Apr 2021 05:23:14 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-192-147.adslplus.ch. [188.155.192.147]) by smtp.gmail.com with ESMTPSA id i25sm2328924edr.68.2021.04.16.05.23.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 05:23:14 -0700 (PDT) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Vladimir Zapolskiy , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] crypto: s5p-sss - simplify getting of_device_id match data Date: Fri, 16 Apr 2021 14:23:09 +0200 Message-Id: <20210416122311.223076-1-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use of_device_get_match_data() to make the code slightly smaller. Signed-off-by: Krzysztof Kozlowski --- drivers/crypto/s5p-sss.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index 8ed08130196f..d613bd557016 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -424,13 +425,9 @@ MODULE_DEVICE_TABLE(of, s5p_sss_dt_match); static inline const struct samsung_aes_variant *find_s5p_sss_version (const struct platform_device *pdev) { - if (IS_ENABLED(CONFIG_OF) && (pdev->dev.of_node)) { - const struct of_device_id *match; + if (IS_ENABLED(CONFIG_OF) && (pdev->dev.of_node)) + return of_device_get_match_data(&pdev->dev); - match = of_match_node(s5p_sss_dt_match, - pdev->dev.of_node); - return (const struct samsung_aes_variant *)match->data; - } return (const struct samsung_aes_variant *) platform_get_device_id(pdev)->driver_data; } From patchwork Fri Apr 16 12:23:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12207527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AD57C43461 for ; Fri, 16 Apr 2021 12:23:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E6C2E611AC for ; Fri, 16 Apr 2021 12:23:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243406AbhDPMXm (ORCPT ); Fri, 16 Apr 2021 08:23:42 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36171 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241180AbhDPMXl (ORCPT ); Fri, 16 Apr 2021 08:23:41 -0400 Received: from mail-ed1-f71.google.com ([209.85.208.71]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lXNVE-0006mq-7Q for linux-samsung-soc@vger.kernel.org; Fri, 16 Apr 2021 12:23:16 +0000 Received: by mail-ed1-f71.google.com with SMTP id b9-20020a05640202c9b029038276b571ddso6921843edx.11 for ; Fri, 16 Apr 2021 05:23:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xuRrK2sERCiDBtlFETS0bmY5iva8IGRiUD4dm9TuXd4=; b=M9JJiHgwxJwtbbIvYjrQSNviAv2AQ/YKsm+Fr/F9jiFGjfZNxT13TRSe2p+vPE4ThG bQpxTHbZRweAeDzeFxLl0wxW1S2vvPz8Fss2919yDPTts5JWSwz+iEaa4X8xsancqWb5 PlHf2/DspCbjrSKhhy+1fMVeCwSHPltJX2QOJYgyDz3r/eeFUluSRYl4d54rDBpNBnug ySDFGpXzeXN83N3NMKM7HVSHE5usKDQV4yGSo7qPnvp3MYXc/cNOvhYCc09j6LT+vuQV qmzdkYcNqJby/58i/9MAEL8JpzlCGgfFdkEK4mgf/nb/KwBNRMjJVHdzDVGUPB1+9nQY z5Qw== X-Gm-Message-State: AOAM5323rcI08fL4QCV4Ylhko0UkWvy/y/HOzQKRC5NxftYx3D/d68aN 9+bT7Vpn0cPPsgafpwnEWL2FjlvOMGYjk0Bmii01/96HgH3/rgtKypH6pQ1py55VpoBrGN18Vyn bbL4LG+KIKQSTCAjAKdNgRsAMD2wa84X4x6bQXsvmNFk9H0yF X-Received: by 2002:a17:906:9a81:: with SMTP id ag1mr8040923ejc.464.1618575795987; Fri, 16 Apr 2021 05:23:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdnin0iDK9J8ErpoBD20g+6ncHdztuhrSzlgqmrf2izOZ21roWcd7CEU6qe6bfTPxitKVrkw== X-Received: by 2002:a17:906:9a81:: with SMTP id ag1mr8040914ejc.464.1618575795818; Fri, 16 Apr 2021 05:23:15 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-192-147.adslplus.ch. [188.155.192.147]) by smtp.gmail.com with ESMTPSA id i25sm2328924edr.68.2021.04.16.05.23.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 05:23:15 -0700 (PDT) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Vladimir Zapolskiy , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] crypto: s5p-sss - remove unneeded local variable initialization Date: Fri, 16 Apr 2021 14:23:10 +0200 Message-Id: <20210416122311.223076-2-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210416122311.223076-1-krzysztof.kozlowski@canonical.com> References: <20210416122311.223076-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The initialization of 'err' local variable is not needed as it is shortly after overwritten. Addresses-Coverity: Unused value Signed-off-by: Krzysztof Kozlowski --- drivers/crypto/s5p-sss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index d613bd557016..8c310816deab 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -2156,7 +2156,7 @@ static struct skcipher_alg algs[] = { static int s5p_aes_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - int i, j, err = -ENODEV; + int i, j, err; const struct samsung_aes_variant *variant; struct s5p_aes_dev *pdata; struct resource *res; From patchwork Fri Apr 16 12:23:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12207529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D412C433B4 for ; Fri, 16 Apr 2021 12:23:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E32BB611AC for ; Fri, 16 Apr 2021 12:23:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243428AbhDPMXo (ORCPT ); Fri, 16 Apr 2021 08:23:44 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36178 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243397AbhDPMXm (ORCPT ); Fri, 16 Apr 2021 08:23:42 -0400 Received: from mail-ed1-f69.google.com ([209.85.208.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lXNVF-0006nH-3G for linux-samsung-soc@vger.kernel.org; Fri, 16 Apr 2021 12:23:17 +0000 Received: by mail-ed1-f69.google.com with SMTP id d27-20020a50f69b0000b02903827b61b783so6958615edn.8 for ; Fri, 16 Apr 2021 05:23:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fzqFDF62IKS/7ZqV+8AeRm9rshpYPcGYLb2VCKEzlxc=; b=R0iak6duVVKYtOxtMgR/HbJ0JK1JPIiMO2kTuyqhLv8IR1uasn01xmdes+CklRp5kO lIZ66/uGRi3it69+lWfQOKTgNZzbzBd+lsy8rUPlNb93jckaa/sstnA42Ul2XRg5l4Ug 4k5GaNx+iuKvoxfgf5A48g6hE+0fEg33OXOUAmesX6XO+ennrr5S9k42jAN5yzUYwbe2 9GBDXRlYX5x5M2adEugvGRY7lD0gjA8xkXVsnXztRROXaMHWxombt5R4PBOz0VIOlaij Urlc0Z3xRtXw9tdY+OlyH9BwtdqtWGTZWtbs50xrFhPzeAQVffWKIU1AglxD9RDLiWzk dxdA== X-Gm-Message-State: AOAM531MYkn9dl3jhV2YdnQ9/+l/gUc2GvF4UCwnZ+7YU4wJFnN/0vpt 4/HKCrJqfBQnYZwja/yh/0mZZLipc/5VL4zSjyOIqWyF5+ToNjPonM4AHeedMbhSCm/KKpWsPYk 79xPwKgNRfzBE/tW3hNB0uq9HpLCJ5DGHQsqVcL56r3qgIfAl X-Received: by 2002:a17:906:a052:: with SMTP id bg18mr8164928ejb.18.1618575796875; Fri, 16 Apr 2021 05:23:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8rqxe4OShPzOPdaQiMJqPwX4MP+1hJHO+t8/0TCP0lXdUaa3BKe1KRRwEsifKkCWnlacHmg== X-Received: by 2002:a17:906:a052:: with SMTP id bg18mr8164918ejb.18.1618575796702; Fri, 16 Apr 2021 05:23:16 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-192-147.adslplus.ch. [188.155.192.147]) by smtp.gmail.com with ESMTPSA id i25sm2328924edr.68.2021.04.16.05.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 05:23:16 -0700 (PDT) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Vladimir Zapolskiy , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] crypto: s5p-sss - consistently use local 'dev' variable in probe() Date: Fri, 16 Apr 2021 14:23:11 +0200 Message-Id: <20210416122311.223076-3-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210416122311.223076-1-krzysztof.kozlowski@canonical.com> References: <20210416122311.223076-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org For code readability, the probe() function uses 'dev' variable instead of '&pdev->dev', so update remaining places. Signed-off-by: Krzysztof Kozlowski --- drivers/crypto/s5p-sss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index 8c310816deab..55aa3a71169b 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -2186,14 +2186,14 @@ static int s5p_aes_probe(struct platform_device *pdev) } pdata->res = res; - pdata->ioaddr = devm_ioremap_resource(&pdev->dev, res); + pdata->ioaddr = devm_ioremap_resource(dev, res); if (IS_ERR(pdata->ioaddr)) { if (!pdata->use_hash) return PTR_ERR(pdata->ioaddr); /* try AES without HASH */ res->end -= 0x300; pdata->use_hash = false; - pdata->ioaddr = devm_ioremap_resource(&pdev->dev, res); + pdata->ioaddr = devm_ioremap_resource(dev, res); if (IS_ERR(pdata->ioaddr)) return PTR_ERR(pdata->ioaddr); }