Message ID | 20230319144439.31399-1-krzysztof.kozlowski@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp761315wrt; Sun, 19 Mar 2023 08:17:45 -0700 (PDT) X-Google-Smtp-Source: AK7set97+N9B8WBMd1qX0aMQD2SDLX080oU1wwMGB/yq92aX6Q4lTiYH/HDovpOajKFoRSqGUhKr X-Received: by 2002:a17:902:f292:b0:1a1:af34:ab35 with SMTP id k18-20020a170902f29200b001a1af34ab35mr5596675plc.2.1679239065278; Sun, 19 Mar 2023 08:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679239065; cv=none; d=google.com; s=arc-20160816; b=djdchIoxpShub32kOzJmjDK3PjWv0blxdqr6OApwolc0oZ4UznyuhMAXiU1T3c55a0 6n9ZCEJFVyB3MlJnbkuHhsjCaRiW3x0vR3CWdxDhytys8hj1YOoKQRlQfYzgUbmg+anb bAL3w6fH48NJc5rUJTqdbsJF3puTvu/8bcuzk0h9ImKsNluv4Y6FA8luZK/At5ZtEJE6 /ZohYy3VSHthCmn9Y69fTL1evOdmoxlsKvH9vQzHpRkr39r4Ay5zfCWKQVhtCQdIFbcd Tt+e9IlPRb7eCFfxNbhDewowwQ9K3W5toKgya0LLszdsGTXfv4vADAGGydIir87zJFJG FfIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wW0qmeq/XE/BS6QmstxltBCzT+Jl3DqWsgHErkJk2t4=; b=eJprvBviiwVHVlEUfVn4HKIHT3pEkHiE4ZE1L/uRWr6hz+ozXar5kSQ2tI9DTfQIzL g72MEoCbRuCDFWTvTnZzNvJhR3kSzu701XoZRZSW60FG/NTPYU6FLtOIwdhFQjFwP8Gb npgErgojPRiGo6OGBRAvRjoMxyLShAxhQTfIhLEg3Bux/7xi093zSxyTMql1IaywkDzY 5Q3z/BqunjCRqNgH57mkiQ1nGg41TaG3vKjVWQzd59zIjt1qIhNxtrxa5gn2QPh15IgN 6Xrf5JWOWx1MHeIkeoF7pCUkqVdB5qSlQO7cn74vhs0BhMI9Z2d7IxRXWL4QVLsYqNkE VzNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZhlRshRB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kx13-20020a170902f94d00b001a1b238d1c0si5275065plb.636.2023.03.19.08.17.30; Sun, 19 Mar 2023 08:17:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZhlRshRB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230462AbjCSOov (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Sun, 19 Mar 2023 10:44:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjCSOot (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 19 Mar 2023 10:44:49 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 417151CBC6 for <linux-kernel@vger.kernel.org>; Sun, 19 Mar 2023 07:44:46 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id er8so25873664edb.0 for <linux-kernel@vger.kernel.org>; Sun, 19 Mar 2023 07:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679237085; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wW0qmeq/XE/BS6QmstxltBCzT+Jl3DqWsgHErkJk2t4=; b=ZhlRshRBEeF/ffBl7mjoVExBy1LfUW86EngFn+0SoXLDONYnFeB0RjOhvD740DDdAq JiSAJjwb4kJ2Gg1MNMAr7Yyt/P8un0+y6PgqLhYkF4y5G4XC5Yl+O2vLHkHJ1NsiuEi6 m3+E+ocdJ7X3Q0VM1iCfXmtc1F0YNyXt29IMQEL9VlQ58NeLCQfKJ8HRcfugC3lphXKO 97ZOsbKI5k93f1iaVtpSgV3eu+AgDvQycjzPYCR4rZnsEGkIFfNuTAnnZS3EIyFUDF7k Q+QzYf8F08tq7D5hITFBmi11FLRyGxJgEQOxrK0mjWV14KpUzoADlhh8h71votf0T5ud 4EZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679237085; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wW0qmeq/XE/BS6QmstxltBCzT+Jl3DqWsgHErkJk2t4=; b=IECJ9ZAwzMASD4+TLZPVHQWRTS9NqUmHSPHdAJWaUyNiy3x7guZjv78BWEI74iBocJ WDqfOSf3KAjMLyjZ5HFdpFT7BprBaNQc8mf7xqf08dO9ji73dK1Cr8n4gi9GyPAnWTlA D8LcxlFVTxoMrjAq1QssRY9beim1tA06bbL7ktRs9h/gT41WR1nKw/GFAU/Vy65zwFUn ZmaMj+1oy0EcocEPwyDYKSDgKmlNDbBQKkhw0jZdfM9IljzweS5ldOo9eL6CP81Dwvjv m7NJCWItYoxu1Llko2/NDDqy+jcuV2XGYUbqvjo8AcSthhCO5TV5DAOxMPIENymlI6Xb vugQ== X-Gm-Message-State: AO0yUKUfAa5dA5bT8IKfpfsPYPU27PIKdzMJXtoOeEryK0Ypmc1pGEgd SHIQwjq6p/r4FIK8L8L2WC85vbcpSVUElL2+e9A= X-Received: by 2002:a17:906:b349:b0:878:6b39:6d2a with SMTP id cd9-20020a170906b34900b008786b396d2amr6835060ejb.46.1679237084757; Sun, 19 Mar 2023 07:44:44 -0700 (PDT) Received: from krzk-bin.. ([2a02:810d:15c0:828:5b5f:f22b:a0b:559d]) by smtp.gmail.com with ESMTPSA id t14-20020a508d4e000000b004d8287c775fsm3583165edt.8.2023.03.19.07.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Mar 2023 07:44:44 -0700 (PDT) From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> To: Herbert Xu <herbert@gondor.apana.org.au>, "David S. Miller" <davem@davemloft.net>, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Subject: [PATCH v2] crypto - img-hash: Depend on OF and silence compile test warning Date: Sun, 19 Mar 2023 15:44:39 +0100 Message-Id: <20230319144439.31399-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760809782436225759?= X-GMAIL-MSGID: =?utf-8?q?1760809782436225759?= |
Series |
[v2] crypto - img-hash: Depend on OF and silence compile test warning
|
|
Commit Message
Krzysztof Kozlowski
March 19, 2023, 2:44 p.m. UTC
The driver is specific to OF platforms (can match only via OF table),
thus add dependency on CONFIG_OF. Mark the of_device_id table as
unused. This also fixes W=1 warning:
drivers/crypto/img-hash.c:930:34: error: ‘img_hash_match’ defined but not used [-Werror=unused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes since v1:
1. Rework - depend on OF and add maybe_unused.
---
drivers/crypto/Kconfig | 1 +
drivers/crypto/img-hash.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
Comments
On Sun, Mar 19, 2023 at 03:44:39PM +0100, Krzysztof Kozlowski wrote: > The driver is specific to OF platforms (can match only via OF table), > thus add dependency on CONFIG_OF. Mark the of_device_id table as > unused. This also fixes W=1 warning: > > drivers/crypto/img-hash.c:930:34: error: ‘img_hash_match’ defined but not used [-Werror=unused-const-variable=] > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> You should either add a dependency on OF or __maybe_unused. Adding both makes no sense. Anyway, what is your final goal here? If it is to get rid of of_match_ptr because of_match_table has been unconditinoal for over 10 years then just do it in one giant patch rather than evaluating every single driver with of_match_table as to whether they can be used through ACPI or not. Thanks,
On 24/03/2023 11:16, Herbert Xu wrote: > On Sun, Mar 19, 2023 at 03:44:39PM +0100, Krzysztof Kozlowski wrote: >> The driver is specific to OF platforms (can match only via OF table), >> thus add dependency on CONFIG_OF. Mark the of_device_id table as >> unused. This also fixes W=1 warning: >> >> drivers/crypto/img-hash.c:930:34: error: ‘img_hash_match’ defined but not used [-Werror=unused-const-variable=] >> >> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > You should either add a dependency on OF or __maybe_unused. > Adding both makes no sense. Of course it makes, otherwise you have warnings which is also fixed here. > > Anyway, what is your final goal here? If it is to get rid of > of_match_ptr because of_match_table has been unconditinoal for > over 10 years then just do it in one giant patch rather than > evaluating every single driver with of_match_table as to whether > they can be used through ACPI or not. My current goal is to pass compile tests. The final goal is not yet decided because final approach is not known. Different people disagree on details, e.g. whether ACPI && !OF should have of_device_id or not. Best regards, Krzysztof
On Fri, Mar 24, 2023 at 11:51:43AM +0100, Krzysztof Kozlowski wrote: > > > You should either add a dependency on OF or __maybe_unused. > > Adding both makes no sense. > > Of course it makes, otherwise you have warnings which is also fixed here. It won't create a warning if you depend on OF without COMPILE_TEST. Anyway, I think adding __maybe_unused by itself is sufficient. Cheers,
On 25/03/2023 06:59, Herbert Xu wrote: > On Fri, Mar 24, 2023 at 11:51:43AM +0100, Krzysztof Kozlowski wrote: >> >>> You should either add a dependency on OF or __maybe_unused. >>> Adding both makes no sense. >> >> Of course it makes, otherwise you have warnings which is also fixed here. > > It won't create a warning if you depend on OF without COMPILE_TEST. In that case yes, but we want COMPILE_TEST for build coverage. > > Anyway, I think adding __maybe_unused by itself is sufficient. Best regards, Krzysztof
On Sat, Mar 25, 2023 at 12:01:47PM +0100, Krzysztof Kozlowski wrote: > > In that case yes, but we want COMPILE_TEST for build coverage. No we don't. Selecting OF is trivial and even the bots will cover this. We have lots of drivers under crypto that depend on COMPILE_TEST as well as OF. > > Anyway, I think adding __maybe_unused by itself is sufficient. If you really want to patch this driver then adding maybe_unused is the way to go. Cheers,
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 3b2516d1433f..4a4aff8b16f0 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -647,6 +647,7 @@ source "drivers/crypto/vmx/Kconfig" config CRYPTO_DEV_IMGTEC_HASH tristate "Imagination Technologies hardware hash accelerator" depends on MIPS || COMPILE_TEST + depends on OF || COMPILE_TEST select CRYPTO_MD5 select CRYPTO_SHA1 select CRYPTO_SHA256 diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c index fe93d19e3044..2be364d9f592 100644 --- a/drivers/crypto/img-hash.c +++ b/drivers/crypto/img-hash.c @@ -927,7 +927,7 @@ static void img_hash_done_task(unsigned long data) img_hash_finish_req(hdev->req, err); } -static const struct of_device_id img_hash_match[] = { +static const struct of_device_id img_hash_match[] __maybe_unused = { { .compatible = "img,hash-accelerator" }, {} };