Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1170483ybe; Fri, 6 Sep 2019 13:01:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOivgd0HzKGBynSpXf6OeBbL1SWaLt5ljGxMe6TQwws5dDn0kebQGKEecUEzo4nUcgZszS X-Received: by 2002:a63:f926:: with SMTP id h38mr9474978pgi.80.1567800062448; Fri, 06 Sep 2019 13:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567800062; cv=none; d=google.com; s=arc-20160816; b=wzk9Ap2/uR5Z3fMDvp/tLnFSBaAZopyy4fF+7+Ynh+akiFOj/pFU2ji2bkdeKwJBB2 SQu7q0NkFoulGSmQaL8E70gWgAEjU2lEK7VY9hvLcWjjbjW3CTPG7hu0w6xA/d7t/R8g oVSAYiuXkXBaHH2lhvLlWz+d5v09jd+0hRsuAw/ov2RXTubrc4GuvvxNVaSWsa1Y+1Yh 49EeTeeK3FJzNQpwsAWAqp9HLsdPLCErFbT/HvskHktgxG2olPOKbEjQsytQ9mGlDxV1 TGuuZBSdiiWiWKWcIl9hVFChGc8y6Q9nRmEpOzy89kzV9P812n+TEUOSVyJTst1Xef2c 4xAw== 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=JEWAXanDHiQ3B0tJQH7qXfrZOK01IgkQOaQAHu/IOb5EP7tkiShYyK+YLxCL/dwdgC /uhYucshenSslcS6yQdkVRoMZPyXttNFhjRrNcEZ4r9TMm4RqbDCphDjCjvnIG/FQiS2 pEEZp236CVIcQUSI9nbZqYP3DZKBNntcPKfXuQtGIdU6WhhymMBhMrV3n0NNY1DelN2C g8dllDpd0V2vpYO9G6PTaCXrikCnJzUR7rrvB57Z2uOPuPzLcPXi6q9R+rf6Qd+oHFc+ 4+O5ylhivkMVKH0ZmBAHlG0KW482tK7c8Yms3I92g4fHYs4WPESLZ27sXV7sHYNdD/gX vaww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 br18si5508472pjb.52.2019.09.06.13.00.18; Fri, 06 Sep 2019 13:01:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394734AbfIFPXL (ORCPT + 99 others); Fri, 6 Sep 2019 11:23:11 -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 Content-Transfer-Encoding: 8bit X-Provags-ID: V03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KfPxsOW/YCvCYP4rH5BXoOt RNl+6LGj/Mb9+BSR0MCo0gag9xYlCsSVtDHAWeMu5SXEq4QyPY= Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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(-) 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 */ -- 2.20.0