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: 422767 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=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 38364C433B4 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 0F89C6117A for ; Fri, 16 Apr 2021 12:23:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243388AbhDPMXl (ORCPT ); Fri, 16 Apr 2021 08:23:41 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36166 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231666AbhDPMXk (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-0006mJ-7N for linux-crypto@vger.kernel.org; Fri, 16 Apr 2021 12:23:15 +0000 Received: by mail-ej1-f72.google.com with SMTP id re9-20020a170906d8c9b029037ca22d6744so1947284ejb.0 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=eMIc8E/Z0+d93SRO7UP2aWM19WWdJbWBFWL0RaZTAAj916Yzm+O+P84iY/WgVj3GuG UhSJeNfDmf464nYhzPpW5XIE8+Md1pb6x7AoOUK9F8f708PLHN2JSXeCnJwxcjQ2UX8N Ro4bBZ44e/h6UhZqlvnLrCQEGF2Dvi4UIE+t1eq6Gd7yDVaJalg4c3ZvewCS224JBKXb g9CYN3nkY5PaNFCxhDLrsVVyrhEeYDTovEovkqkFWh/Jt8JG82XUYPEaYizUGDYm3CdV lfoGVdnSJb5smAu2chUDKhipGVRu2vXgFmsppzZwusDh4XbkIXPwzzsXAJNZ/xCfr+6h jsnA== X-Gm-Message-State: AOAM530NI+ZinicozuCu1zKgOr2OsUFikt8GVNFnb8Q/cKk6Uh0O03AH LNabw9lhTxW/yrktzz4Ve3PPx0mfngwisqZSaFTRLjR2VHZvZjQ6k1hsy8IblJq6KH4NHvlEmzE yISBwTVR2T4d37OVivpIjYVv0sWJ6XaYcVQj3Uxkj9w== X-Received: by 2002:a17:906:cc88:: with SMTP id oq8mr3697679ejb.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-crypto@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: 423505 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=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 B335CC43462 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 91849610FA for ; Fri, 16 Apr 2021 12:23:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240486AbhDPMXm (ORCPT ); Fri, 16 Apr 2021 08:23:42 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36176 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243385AbhDPMXl (ORCPT ); Fri, 16 Apr 2021 08:23:41 -0400 Received: from mail-ed1-f70.google.com ([209.85.208.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lXNVE-0006ms-82 for linux-crypto@vger.kernel.org; Fri, 16 Apr 2021 12:23:16 +0000 Received: by mail-ed1-f70.google.com with SMTP id w15-20020a056402268fb02903828f878ec5so6898548edd.5 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=CQz+sf8MElFUaBJzJQ8X+HlWRac6QFfbxLkM8Jvm+BMKiI393RJV3Tbbq23gwZkhJs NDGaZ0TsNDlKY3984DrT6CUEw7x9qyjq6PuHuH3JNIGk+c1zxAos6RnPKdeBFRLR0xNn Q00sN7t8SPQG0DZhppGO6PwxseW7GL3BfT8D04vr3wb27pPsnX3FZokaPDXfeistU0hY goJkArHjVGSfivmEzYfmuvRAlQv/6U6Wi4xgu1v2YewD27vrazYr8ykPntcUX+lXEIxv 2L23JdnXfmI6acr5diwRyH4PNGcolwKOHomwLY2xzNYv4sar9C5ho3WJTOH/cI1GL0Qw Xrrg== X-Gm-Message-State: AOAM530EdmBTJ7MUo+zei0mJ0nXtdespZtDWtIOrwpyQxv/TII1UnMM8 I8gwvSiKLKymuQAFPAYFpBi43OWuVRZjnZeDK/2wiBI8fG+yEjcpXJ6KhjoRT681YSIpaifX8lO bDKGeKgyPuE/XtQHYDGl3agJL/Nm+G+MkKKkQsGsmOg== X-Received: by 2002:a17:906:9a81:: with SMTP id ag1mr8040924ejc.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-crypto@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: 422766 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=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 8914BC433ED for ; Fri, 16 Apr 2021 12:23:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 66EB9611AB for ; Fri, 16 Apr 2021 12:23:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235263AbhDPMX4 (ORCPT ); Fri, 16 Apr 2021 08:23:56 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36181 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243401AbhDPMXm (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-0006nK-3r for linux-crypto@vger.kernel.org; Fri, 16 Apr 2021 12:23:17 +0000 Received: by mail-ed1-f69.google.com with SMTP id s4-20020a0564021644b0290384e9a246a7so3298716edx.7 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=XVpb+1TfOyfrbohCAEKbEHcFggrZLeD1xLTJBi8+yqrCZNGCOQijORvA8c+V4kWHbM tD1fISDOB92GX2t2RsPypMhHe5yR3Zl3fB2LuZTxbXnV0nFNwVlTivwDayILDxMrGE8C ChyvdyBpknPcuqE2LgIU+MoFpvv+dZN8HqC4ZP0f/BqjH1usxXH4BKn8DGCA5oVvTHBl cPiurdzmrKg8dVN7rUQw1dV6levFKDJgIT/mszFChQkXscOidFTe3TmtlDq5IHtoGXM4 kVuzaikuR1vXsm4VdXCIjTUES2JGyO2F4hiKrNkJf/o1dzsjNZ1u36E/IkzBbRWmK4s6 rtqw== X-Gm-Message-State: AOAM531jrJmPfrzkoMxIeHxOujX+ct7f+e/Vw3pmkVUka/JVJBYEHIQJ fMYLfza2xDiMP47gNkpmeyd+2HaGkYJ47imXoA22pyKTCIyaI5a1tZAPK033AhQVhi3khwYY/eT RpuJdWlNPe8hBtnhpg9LtHP/jjP/WoR0esCtUtPfoMA== X-Received: by 2002:a17:906:a052:: with SMTP id bg18mr8164932ejb.18.1618575796876; 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-crypto@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); }