From nobody Wed Apr 15 00:02:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81DF2C19F2B for ; Fri, 29 Jul 2022 09:36:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235196AbiG2JgD (ORCPT ); Fri, 29 Jul 2022 05:36:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233564AbiG2JgA (ORCPT ); Fri, 29 Jul 2022 05:36:00 -0400 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C17D558B6B; Fri, 29 Jul 2022 02:35:56 -0700 (PDT) Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1oHMP5-005nJz-LG; Fri, 29 Jul 2022 19:35:33 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 29 Jul 2022 17:35:31 +0800 Date: Fri, 29 Jul 2022 17:35:31 +0800 From: Herbert Xu To: kernel test robot Cc: Vinod Koul , kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Linus Walleij , Linux Crypto Mailing List Subject: [PATCH] crypto: qcom-rng - Fix qcom_rng_of_match unused warning Message-ID: References: <202207240830.NxaVYPVM-lkp@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <202207240830.NxaVYPVM-lkp@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Sun, Jul 24, 2022 at 08:12:39AM +0800, kernel test robot wrote: > > >> drivers/crypto/qcom-rng.c:190:34: warning: 'qcom_rng_of_match' defined= but not used [-Wunused-const-variable=3D] > 190 | static const struct of_device_id qcom_rng_of_match[] =3D { > | ^~~~~~~~~~~~~~~~~ Reported-by: kernel test robot Reviewed-by: Vinod Koul ---8<--- Module device tables need to be declared as maybe_unused because they will be unused when built-in and the corresponding option is also disabled. This patch adds the maybe_unused attributes to OF and ACPI. This also allows us to remove the ifdef around the ACPI data structure. Reported-by: kernel test robot Signed-off-by: Herbert Xu diff --git a/drivers/crypto/qcom-rng.c b/drivers/crypto/qcom-rng.c index 031b5f701a0a..72dd1a4ebac4 100644 --- a/drivers/crypto/qcom-rng.c +++ b/drivers/crypto/qcom-rng.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -201,15 +202,13 @@ static int qcom_rng_remove(struct platform_device *pd= ev) return 0; } =20 -#if IS_ENABLED(CONFIG_ACPI) -static const struct acpi_device_id qcom_rng_acpi_match[] =3D { +static const struct acpi_device_id __maybe_unused qcom_rng_acpi_match[] = =3D { { .id =3D "QCOM8160", .driver_data =3D 1 }, {} }; MODULE_DEVICE_TABLE(acpi, qcom_rng_acpi_match); -#endif =20 -static const struct of_device_id qcom_rng_of_match[] =3D { +static const struct of_device_id __maybe_unused qcom_rng_of_match[] =3D { { .compatible =3D "qcom,prng", .data =3D (void *)0}, { .compatible =3D "qcom,prng-ee", .data =3D (void *)1}, {} --=20 Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt