Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2823400imm; Mon, 24 Sep 2018 10:28:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV62NUqxjLq1aKsoMSz1MmHC4MqjcpWaCJ+2cAs0hhTcOlMNXEMqOGy9okZlfJIJysATgjxqH X-Received: by 2002:a17:902:6a83:: with SMTP id n3-v6mr11535124plk.246.1537810117792; Mon, 24 Sep 2018 10:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537810117; cv=none; d=google.com; s=arc-20160816; b=qlEcTovq2K1nzSTVDiITYIKOaZXO78eJWSXVQzRfZxrxFRFIdC0LMGp7UpsuR9CBjk x1ne6bsc9k2Kug8F39cW/xX7rk6vMe+iHSfQT2B1c/R6ou87yOdoL7NqIEitE66pWxj2 kPDWyy0qUIPxENcnDITYlkMIphW03ZAQCQwXj4KbytNjwdruY2dKpoQ3XtZNqioUbxCn mGvQ457AoIxKoWcN8S731XO0SDzjljUYYspVwgGEYBYx3g9hrAG5SCML4CmNKKb8+4ux Rp4Ko+x2lJrlxGAjAclRzMrA7JzcqCsNxaur19Fyxx9MDooAXyl09eIZdpANcRjEBfsc ZLpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=63LIMb6KbDrx/QBE3cb2KhMnQMLOmx1TirKP2yjUk+I=; b=LJpcZSuP3ch76tqcD/KV5zomXL7eE1Se2cK/TAF+xpLBQbywbVbPAw5bi2cQTKIeJU 4TsYCF7HEVMgJ7DyiyqgPmiODWRfOrf7bQDzeuE3Xx2xQjQeUhGYoCq4Nb+m+OuODFDw G4DU8HxrtTvIUCFMn45Md7PV48qrgAtjaxh1sJg/ce4ZZ7CfPSZYgthHP1L1prQ98RY9 sIYiRhVOa0XUtAbXVMs0y8HjwoHRDZ7eY/2Fbk9BuJuRoe12N82ZmJ1g0cAFayqMzaAo 8z0CV0dU8g4hnUr5+TkPvfCKKAaoV1V14Ulos/0Xl02MB/a+CE4/8jtkCFNYg1B69zFJ N1xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NenG7WWw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d185-v6si20054909pfg.102.2018.09.24.10.28.22; Mon, 24 Sep 2018 10:28:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NenG7WWw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732743AbeIXX3q (ORCPT + 99 others); Mon, 24 Sep 2018 19:29:46 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:40376 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728916AbeIXX3p (ORCPT ); Mon, 24 Sep 2018 19:29:45 -0400 Received: by mail-wm1-f67.google.com with SMTP id o2-v6so4288476wmh.5; Mon, 24 Sep 2018 10:26:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=63LIMb6KbDrx/QBE3cb2KhMnQMLOmx1TirKP2yjUk+I=; b=NenG7WWw0PAIlu5x+XyNteeSQtkM929W+LOtG3LBwA6/AUneVG0gP1wPzYg32J99gz NMFimf82E/4pUdVbPIYrxYFwDfbKNZPLWTJ4LKk8A2Vl8OM3gCA+mYIVjyLGTBtEISof XiSe2/8y592ARimbmCC7FWI47vov39W3LukoPswilw7HToW1vD/eOEcSumcmgum8Jv36 nV72ry+q2WZq39D4610YRT3uJDoT05iM3AKv4OtuU6nPip02+pa0Tof7PfYjJN3zZv4/ ixJ3hDHaOVEXwF6rfu21LzpUvq0dayAKskKblSUAw2v2LHbX5r7mrC4z9PWNMEP+Stuj H4tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=63LIMb6KbDrx/QBE3cb2KhMnQMLOmx1TirKP2yjUk+I=; b=gFGX4QA4PaUIzFasQfOih7JuS7FSVAVR9DU7gMTZc3DPuWXIKihD1BiJtaqTpZJnev n+116CXwpsTEFQSgDNeKZBobLu8N2yVKennwRrM7sjatpsTx8ESKJzgraF6BVbKpaSev 5lxq3WKZuVaDjdQ7lWm8MLksySfWhUGMkorQbdU1h7QxEogQjkbRqBcORKMG52aHFvcE q9f0xAlNGEzW2KmuKQnivQhAIF96K0OT3n2/HFHPOWTeZTAsow+z+Ms4+UBa0GF/NN45 RcXvKMNuYlvZatkLDfy74std5AJVO0+oqNwRuz9Yp/tDALOV+bR425ZmmQj7PSYosUMh YBYA== X-Gm-Message-State: ABuFfogH0lAMAXbNjNxX1mMeQHifNPmAwhkUqGqTj2YrXtWVJb8N4iY/ 8warNJNHE4ekzRjGdtASsnw= X-Received: by 2002:a1c:1584:: with SMTP id 126-v6mr8416852wmv.24.1537809992104; Mon, 24 Sep 2018 10:26:32 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id z10-v6sm36480032wrv.22.2018.09.24.10.26.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 10:26:31 -0700 (PDT) From: Nathan Chancellor To: Tom Lendacky , Gary Hook , Herbert Xu Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Nathan Chancellor Subject: [PATCH] crypto: ccp: Remove forward declaration Date: Mon, 24 Sep 2018 10:26:15 -0700 Message-Id: <20180924172615.25591-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang emits a warning about this construct: drivers/crypto/ccp/sp-platform.c:36:36: warning: tentative array definition assumed to have one element static const struct acpi_device_id sp_acpi_match[]; ^ 1 warning generated. Just remove the forward declarations and move the initializations up so that they can be used in sp_get_of_version and sp_get_acpi_version. Reported-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- drivers/crypto/ccp/sp-platform.c | 53 +++++++++++++++----------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/drivers/crypto/ccp/sp-platform.c b/drivers/crypto/ccp/sp-platform.c index 71734f254fd1..b75dc7db2d4a 100644 --- a/drivers/crypto/ccp/sp-platform.c +++ b/drivers/crypto/ccp/sp-platform.c @@ -33,8 +33,31 @@ struct sp_platform { unsigned int irq_count; }; -static const struct acpi_device_id sp_acpi_match[]; -static const struct of_device_id sp_of_match[]; +static const struct sp_dev_vdata dev_vdata[] = { + { + .bar = 0, +#ifdef CONFIG_CRYPTO_DEV_SP_CCP + .ccp_vdata = &ccpv3_platform, +#endif + }, +}; + +#ifdef CONFIG_ACPI +static const struct acpi_device_id sp_acpi_match[] = { + { "AMDI0C00", (kernel_ulong_t)&dev_vdata[0] }, + { }, +}; +MODULE_DEVICE_TABLE(acpi, sp_acpi_match); +#endif + +#ifdef CONFIG_OF +static const struct of_device_id sp_of_match[] = { + { .compatible = "amd,ccp-seattle-v1a", + .data = (const void *)&dev_vdata[0] }, + { }, +}; +MODULE_DEVICE_TABLE(of, sp_of_match); +#endif static struct sp_dev_vdata *sp_get_of_version(struct platform_device *pdev) { @@ -201,32 +224,6 @@ static int sp_platform_resume(struct platform_device *pdev) } #endif -static const struct sp_dev_vdata dev_vdata[] = { - { - .bar = 0, -#ifdef CONFIG_CRYPTO_DEV_SP_CCP - .ccp_vdata = &ccpv3_platform, -#endif - }, -}; - -#ifdef CONFIG_ACPI -static const struct acpi_device_id sp_acpi_match[] = { - { "AMDI0C00", (kernel_ulong_t)&dev_vdata[0] }, - { }, -}; -MODULE_DEVICE_TABLE(acpi, sp_acpi_match); -#endif - -#ifdef CONFIG_OF -static const struct of_device_id sp_of_match[] = { - { .compatible = "amd,ccp-seattle-v1a", - .data = (const void *)&dev_vdata[0] }, - { }, -}; -MODULE_DEVICE_TABLE(of, sp_of_match); -#endif - static struct platform_driver sp_platform_driver = { .driver = { .name = "ccp", -- 2.19.0