From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 D0D48C47089 for ; Thu, 27 May 2021 17:46:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B4B196052B for ; Thu, 27 May 2021 17:46:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232006AbhE0RsB (ORCPT ); Thu, 27 May 2021 13:48:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:41278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbhE0RsA (ORCPT ); Thu, 27 May 2021 13:48:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 296B6610A0; Thu, 27 May 2021 17:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622137587; bh=5ZRnfqRtr/J0QJfUg5D/PQYEwhdZT/hAb/+xrZGlOHU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sfxmwW3029z6rLKsitywLDXKyPX2OAKi30JDxN16STWTO7Fxr26PZB76nT//N540K pRypVB7E/b6rGdqtZClQjJc8LMRnIC5xOSC0ADPOa9ShWoBd1L53v9UPYZfOaQGizi JCJFp0jsRUvikoaoRoM/v4tIfoJphf/G/PE/22KFIDahZV/uVG4vfYkYbYHCrp4VXw gj3NDBIrliYRl/rkDUKMsF55itmp2+QosiiK2VFN7RP/bPwxP3W0Ydcui6imex8A5B Rzi9DYUBlZ+yusdeVDv99S++VjNIi8Fl+mwOyxIbsU/oyzgzZdb2Hqo5tZhTzPLwD7 69u+6T9vDNbtA== Date: Thu, 27 May 2021 10:46:25 -0700 From: Eric Biggers To: Austin Kim Cc: herbert@gondor.apana.org.au, davem@davemloft.net, catalin.marinas@arm.com, will@kernel.org, john.johansen@canonical.com, jmorris@namei.org, serge@hallyn.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-security-module@vger.kernel.org, linux-crypto@vger.kernel.org, austin.kim@lge.com Subject: Re: [PATCH] crypto: arm64/gcm - remove Wunused-const-variable ghash_cpu_feature Message-ID: References: <20210527062809.GA1251@raspberrypi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210527062809.GA1251@raspberrypi> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, May 27, 2021 at 07:28:09AM +0100, Austin Kim wrote: > > The variable with MODULE_DEVICE_TABLE() is registered as platform_driver. What does this mean? There is no platform_driver involved here at all. > But ghash_cpu_feature is not used, so remove ghash_cpu_feature. It is used when the file is built as a module. > diff --git a/arch/arm64/crypto/ghash-ce-glue.c b/arch/arm64/crypto/ghash-ce-glue.c > index 720cd3a58da3..c3f27d0d5329 100644 > --- a/arch/arm64/crypto/ghash-ce-glue.c > +++ b/arch/arm64/crypto/ghash-ce-glue.c > @@ -615,10 +615,5 @@ static void __exit ghash_ce_mod_exit(void) > crypto_unregister_shash(&ghash_alg); > } > > -static const struct cpu_feature ghash_cpu_feature[] = { > - { cpu_feature(PMULL) }, { } > -}; > -MODULE_DEVICE_TABLE(cpu, ghash_cpu_feature); > - Probably adding __maybe_unused to ghash_cpu_feature[] is the right thing to do. That's what module_cpu_feature_match() does. (Note that module_cpu_feature_match() can't be used here, as it seems the intent is for this module to be autoloaded when PMULL is detected, but still be loadable without it. So, that's apparently the reason for using MODULE_DEVICE_TABLE() directly.) - Eric From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 13470C47089 for ; Thu, 27 May 2021 19:03:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CECD9613DD for ; Thu, 27 May 2021 19:03:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CECD9613DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=e13F3egdYLwraFcLhsvuPvTRKgWpS+Uzf0WM77f/NtY=; b=RtiQf5I2yxI9Vd oXHRBJnuLl5Psk6rh6Rb833PtcLQt7cX3dgZD5OKsZ3/GuY7EAad95RYhodMe9zdjNBuGZM3EjEb9 den168yDWccfKS01mVA1v2L+nPmur3WRRXatsExidRyMy7cboDrrb5Vm3qexEe0NxHEF8FwQylkJf tXyMi3+AbiHCihifQrEY4tqEDC+iFi4+Bk4Cxxn0FCUa+pApgJHzX+J2P/iznArbku4QJCO4jJXsN KUk+s4f6IBC1i1u3/lh1tT0lOwtf3YRSuy5XijX4ozCN95pGgJY6ddYEgehrapmbmUBPmhiM7w3aU 1h6sjwWHDMFj2bmMmAYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmLFO-008kcC-ID; Thu, 27 May 2021 19:00:49 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmK5U-008DOP-KR for linux-arm-kernel@lists.infradead.org; Thu, 27 May 2021 17:46:29 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 296B6610A0; Thu, 27 May 2021 17:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622137587; bh=5ZRnfqRtr/J0QJfUg5D/PQYEwhdZT/hAb/+xrZGlOHU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sfxmwW3029z6rLKsitywLDXKyPX2OAKi30JDxN16STWTO7Fxr26PZB76nT//N540K pRypVB7E/b6rGdqtZClQjJc8LMRnIC5xOSC0ADPOa9ShWoBd1L53v9UPYZfOaQGizi JCJFp0jsRUvikoaoRoM/v4tIfoJphf/G/PE/22KFIDahZV/uVG4vfYkYbYHCrp4VXw gj3NDBIrliYRl/rkDUKMsF55itmp2+QosiiK2VFN7RP/bPwxP3W0Ydcui6imex8A5B Rzi9DYUBlZ+yusdeVDv99S++VjNIi8Fl+mwOyxIbsU/oyzgzZdb2Hqo5tZhTzPLwD7 69u+6T9vDNbtA== Date: Thu, 27 May 2021 10:46:25 -0700 From: Eric Biggers To: Austin Kim Cc: herbert@gondor.apana.org.au, davem@davemloft.net, catalin.marinas@arm.com, will@kernel.org, john.johansen@canonical.com, jmorris@namei.org, serge@hallyn.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-security-module@vger.kernel.org, linux-crypto@vger.kernel.org, austin.kim@lge.com Subject: Re: [PATCH] crypto: arm64/gcm - remove Wunused-const-variable ghash_cpu_feature Message-ID: References: <20210527062809.GA1251@raspberrypi> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210527062809.GA1251@raspberrypi> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210527_104628_734615_DCF0849E X-CRM114-Status: GOOD ( 15.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 27, 2021 at 07:28:09AM +0100, Austin Kim wrote: > > The variable with MODULE_DEVICE_TABLE() is registered as platform_driver. What does this mean? There is no platform_driver involved here at all. > But ghash_cpu_feature is not used, so remove ghash_cpu_feature. It is used when the file is built as a module. > diff --git a/arch/arm64/crypto/ghash-ce-glue.c b/arch/arm64/crypto/ghash-ce-glue.c > index 720cd3a58da3..c3f27d0d5329 100644 > --- a/arch/arm64/crypto/ghash-ce-glue.c > +++ b/arch/arm64/crypto/ghash-ce-glue.c > @@ -615,10 +615,5 @@ static void __exit ghash_ce_mod_exit(void) > crypto_unregister_shash(&ghash_alg); > } > > -static const struct cpu_feature ghash_cpu_feature[] = { > - { cpu_feature(PMULL) }, { } > -}; > -MODULE_DEVICE_TABLE(cpu, ghash_cpu_feature); > - Probably adding __maybe_unused to ghash_cpu_feature[] is the right thing to do. That's what module_cpu_feature_match() does. (Note that module_cpu_feature_match() can't be used here, as it seems the intent is for this module to be autoloaded when PMULL is detected, but still be loadable without it. So, that's apparently the reason for using MODULE_DEVICE_TABLE() directly.) - Eric _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel