From patchwork Fri Sep 6 15:22:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 173255 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp863057ilq; Fri, 6 Sep 2019 08:23:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqx17DI9k3ljpzem3AyIfqOK3Bipxmpnaglw9a7Zwm2nx8D3Y6AjSRx5uYkfgdl5g6FM9VXW X-Received: by 2002:a17:902:b115:: with SMTP id q21mr9951903plr.241.1567783393171; Fri, 06 Sep 2019 08:23:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567783393; cv=none; d=google.com; s=arc-20160816; b=YB1FeTQeI3U7Jxq2hpzLSUJaVDPAt54hUwpSwF4/kN8CVBJ/MvZB4omNtWiAbYz7lC MX2CCI0li2uz+kBeHMfhSFjXVV3dKRod0LGafI+UPaZ6dZnDssUcQWU9OStmq5u7Wd8C JDb6Uu7Zg0Cdw7CWjcPGbjwRaZTPJs5Z0miHCYXIFKRW9fM5cxY+LxWVioSZdC6vkSM2 v4ITikP64VjI3GNpsUn4zaUEshTllfifP0iAevRmPcxtRjkHiJ1C/CpjkHkXNojBSDZ/ X/w3fjQfTLM95tAblTUGmliWXmHcM12SHhrTwu7dzIiwHbUh5Z6t63l61vt+Z44i7Ltw 2cVQ== 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; bh=IeTy7bCAQPXdvA+i5qxbRQUWH6MpGlPlYSEZ7+hZuug=; b=G1kRCUaQ3zWXVX4BeDgA6rEJgPgui31zKapn2oXNHS9J8ZUZP/uQc5sAJy8/gmbUpv YTvxE5y80uhAnVX1pcMPxUtcl8CttghIwBBCywPtkvEniP5YJFojwDW/L3lMAeWMr2Jk HVwL7DfR52nctXFwjnzrL8EH/N2PGEsGf3826R3qCfU6G2gb6AQxgIBzQZApbtqp8h+Z tr0194iWGy2ssjfCkWaAxWnRTrSzc5UU1GiJ0/H5/N8ImEb6sEH1EpbdIVBDuq4J3ba+ Rz96f4wErQlMd+KbFlzc5RWVUDg5HuKESQxRolaUGY40mvF+3BGFbB662Ry1q+fZOU8i YUXA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24si5038321plr.187.2019.09.06.08.23.12; Fri, 06 Sep 2019 08:23:13 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394744AbfIFPXM (ORCPT + 28 others); Fri, 6 Sep 2019 11:23:12 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:32893 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387557AbfIFPXL (ORCPT ); Fri, 6 Sep 2019 11:23:11 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1MQ5aw-1hkAou31pA-00M5hb; Fri, 06 Sep 2019 17:22:52 +0200 From: Arnd Bergmann To: Herbert Xu , "David S. Miller" , Antoine Tenart Cc: Arnd Bergmann , Pascal van Leeuwen , Ard Biesheuvel , Kees Cook , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] crypto: inside-secure - fix uninitialized-variable warning Date: Fri, 6 Sep 2019 17:22:29 +0200 Message-Id: <20190906152250.1450649-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:u547Yb77RHO15kDZX4JTrsBGpb64BliQTLpiUK93UQdkYW08oE8 U2DBhk8auGRevbg3P7wWD0SvYnA8yvjFpmlj0dnVypm38xB4q6uqiIEsjLJnkvV+VfWZ/nG LPPHP0ygT2s0dSdaqNz/YpdCERJ7sgtZOCAIKM3ojYAVvInaQdG3F5KSVWed2QCoolHsgG1 4zpc9UGWFRvw2bjETOBug== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:bnjJzuxwR8o=:zTI8B7lwfhDUvN6/jeDt8r 43CebgMnsG/r6n0jVItqrGmSlJngNg2Mu8B/x5Jk7ejXZta/KEFf7dRmQRb4Y4KwGE0WSRFEb lzTvnFaIz/cR9hSewht/+KDHys+jMtTfVDKDQivgrR6cRNSSDAD7cPowgfXQd5RiVWF2V8zHu U07yvxCeoCtozv+OyBc7ugWnFuH7cAsvJlg4sAh4muUYRrP3seK8QSzbxzE8TYyLjNnBou3uC b40jeQSkGyw2lQ9Mk1CNgGROHw4RD5dBlFq2wgucjaO8zOfMxIKNMnb9YlruQttyvUj7ZN2Dt JOh3RebyFHNpvIO5dILhbmL+OtMhENWhxurStERv++LxeCHuQASNKp2qlOMt6tMnDmreMOl2s 9SqMB5g61bgkeZzwa5MHC11yz9Td4mvowUXSMPVV/jpYG9tFqBvLOIvM1+CoBBpCCy1qXuqM4 N+/Eue3u9uiDFJS7u8ZZ/isl8IBMC8DBuLmBBUpSI1mhQf4RBBvx1Cm6fIiHVg5GqGZ8fy+vk XHTq7YDzgT0LvfCvdR0+i7wzTQ1ExFwteFg0BnQ0Y9B767GgDccSAPWeyc01q8zR+alvOqumx tjrMuDKgRMdAJ+NgT5ys4qyI2vpaqUca/nTJFikmYKpNMVRdOQanqzJiurafJEa+laYjbskGx rwI2Y6dGTIQx7bxQcrLsbh4z917uhgDZ/cm3r23BwCJExQQbN+C+5GRxxjkfl9iWj11vRixkO Hzo9Jivr0r9yiX2y4CmX98SVv19nqUSEDE6XNKLPWEU048MY/pKfPxsOW/YCvCYP4rH5BXoOt RNl+6LGj/Mb9+BSR0MCo0gag9xYlCsSVtDHAWeMu5SXEq4QyPY= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The addition of PCI support introduced multiple randconfig issues. - When PCI is disabled, some external functions are undeclared: drivers/crypto/inside-secure/safexcel.c:944:9: error: implicit declaration of function 'pci_irq_vector' [-Werror,-Wimplicit-function-declaration] - Also, in the same configuration, there is an uninitialized variable: drivers/crypto/inside-secure/safexcel.c:940:6: error: variable 'irq' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] - Finally, the driver fails to completely if both PCI and OF are disabled. Take care of all of the above by adding more checks for CONFIG_PCI and CONFIG_OF. Fixes: 625f269a5a7a ("crypto: inside-secure - add support for PCI based FPGA development board") Signed-off-by: Arnd Bergmann --- drivers/crypto/Kconfig | 2 +- drivers/crypto/inside-secure/safexcel.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) -- 2.20.0 diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 3c4361947f8d..048bc4b393ac 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -719,7 +719,7 @@ source "drivers/crypto/stm32/Kconfig" config CRYPTO_DEV_SAFEXCEL tristate "Inside Secure's SafeXcel cryptographic engine driver" - depends on OF || PCI || COMPILE_TEST + depends on OF || PCI select CRYPTO_LIB_AES select CRYPTO_AUTHENC select CRYPTO_BLKCIPHER diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c index e12a2a3a5422..9c0bce77de14 100644 --- a/drivers/crypto/inside-secure/safexcel.c +++ b/drivers/crypto/inside-secure/safexcel.c @@ -938,6 +938,7 @@ static int safexcel_request_ring_irq(void *pdev, int irqid, struct device *dev; if (IS_ENABLED(CONFIG_PCI) && is_pci_dev) { +#ifdef CONFIG_PCI struct pci_dev *pci_pdev = pdev; dev = &pci_pdev->dev; @@ -947,6 +948,7 @@ static int safexcel_request_ring_irq(void *pdev, int irqid, irqid, irq); return irq; } +#endif } else if (IS_ENABLED(CONFIG_OF)) { struct platform_device *plf_pdev = pdev; char irq_name[6] = {0}; /* "ringX\0" */ @@ -960,6 +962,8 @@ static int safexcel_request_ring_irq(void *pdev, int irqid, irq_name, irq); return irq; } + } else { + return -ENXIO; } ret = devm_request_threaded_irq(dev, irq, handler, @@ -1138,6 +1142,7 @@ static int safexcel_probe_generic(void *pdev, safexcel_configure(priv); if (IS_ENABLED(CONFIG_PCI) && priv->version == EIP197_DEVBRD) { +#ifdef CONFIG_PCI /* * Request MSI vectors for global + 1 per ring - * or just 1 for older dev images @@ -1152,6 +1157,7 @@ static int safexcel_probe_generic(void *pdev, dev_err(dev, "Failed to allocate PCI MSI interrupts\n"); return ret; } +#endif } /* Register the ring IRQ handlers and configure the rings */ @@ -1503,7 +1509,9 @@ static struct pci_driver safexcel_pci_driver = { static int __init safexcel_init(void) { +#ifdef CONFIG_PCI int rc; +#endif #if IS_ENABLED(CONFIG_OF) /* Register platform driver */