Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp998314ybe; Thu, 19 Sep 2019 07:10:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQATcO41kF7I/PAbH2damk0XJ6DMBrR2DegqAC2N454phDWsRBPx6fuowggFl1lOFfvZg8 X-Received: by 2002:a17:906:90d4:: with SMTP id v20mr9124721ejw.189.1568902250423; Thu, 19 Sep 2019 07:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568902250; cv=none; d=google.com; s=arc-20160816; b=QXvzo/5XYA9CBR8qJFeGsYmLhVKqkDsPssmpYBvUCwTc76gseAxutYiLqs8WUvKlea 5Z7znY1umSTliHpyFkC9Ox8alMX2je4Td/Fx7vvu8oyoJZ+ewdhooazm5sVFUtpsmCy8 ZHo9ReTbJcfOV1IGhJqraapTGen2f8W9mr8lfvfVILVC3Bbyfw8rTJPDYIgTAfpHlPih j7DK7mrguvlYXU2EF3TSwmjOhdrXYbL8UFjTvrrbt9o3Gvdt0hdtzwoZSZUfnBAFbgMV UR1kSnMOoLDUnzsYxAScwoWcWaHJSZL26tH3t6xbz7vCzWk2CYpP2DLkcbok+QI87whH m2HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=cxoOCzciOIRUmGCqyjlsgINy4NQTOCEgzeg4ovLh364=; b=xBCb78e61ZxuSyEuBbE7k9SpW7p4bOIYQf9x7ZPxzkEL1aIfgfrOrLMDOtZ1k0rzvP or5h+PTaHSXqQA2FJhALzOzBbDavKXxnBoShyKEoy+BfGcTQtEnFy5u1EFi/YH2AXE5t hDEfUyNLNeOlLu+OfFXVPCJg8DTU7huvu2wUbSzE0oPCKDuSmbM58jKmxTkUJwYBeu4L iJZslNblyMOdXQsZru2vzOaSA8UfxPFWEN6uY11KN42ciSWmbnZLkUDND4Mz1gn5iEjJ tj6afQZ7H6R50QjP30bBm8Q/sw2LJxXNu8Ix0fM45gljpF4sV8Lx+CbCTHDbpCtppuqA 8Ucg== 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 i27si4464821ejg.249.2019.09.19.07.10.25; Thu, 19 Sep 2019 07:10:50 -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 S2388639AbfISOH7 (ORCPT + 99 others); Thu, 19 Sep 2019 10:07:59 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:39944 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387729AbfISOH6 (ORCPT ); Thu, 19 Sep 2019 10:07:58 -0400 Received: by mail-qt1-f196.google.com with SMTP id x5so4357890qtr.7; Thu, 19 Sep 2019 07:07:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cxoOCzciOIRUmGCqyjlsgINy4NQTOCEgzeg4ovLh364=; b=EmQfLV/lExPB7whTzZ6ypsrApa3MZ20V9toLnApO1hPAkNo77RzQf71M7oZrcXGAhN rs0blTAVDE0tw2hSVrRGhC7FtvcMJ0tv57MXufCqIsdiae1WKhKzMqKsZf+teO2Xff7Y eH3tELBaBpWXMBXNPSPYCv/svEqNE+hQwB/ucQ+HgkzgsFnFo1Najmn2XlqCvSGgPvdQ 496qXuLmoIgCCnOlYfxVyMzQOrLqmHwXA4HXTWxOGEcagmM/ngMK0xhRSfEr6Bpb13Ku JS4rQjbWWEMFjHEMKN+VpFMkyoKNE0DVedQcqtfy108RF/n2JcY7rJibcvIH0rXVRrbR DQsg== X-Gm-Message-State: APjAAAVjm81ERUPemh6/9ycoGJj3LaDqIkMzOOX16mrT+yHE+eaMHpst zIEPsRYXBtHkj6uAL8694Tarapqud6bcmZZreGQ= X-Received: by 2002:ac8:342a:: with SMTP id u39mr3343955qtb.7.1568902077622; Thu, 19 Sep 2019 07:07:57 -0700 (PDT) MIME-Version: 1.0 References: <20190906152250.1450649-1-arnd@arndb.de> <20190906152250.1450649-2-arnd@arndb.de> <20190913091718.GA6382@gondor.apana.org.au> <5D833821.5000504@hisilicon.com> <20190919134813.GB29320@gondor.apana.org.au> In-Reply-To: <20190919134813.GB29320@gondor.apana.org.au> From: Arnd Bergmann Date: Thu, 19 Sep 2019 16:07:41 +0200 Message-ID: Subject: Re: [PATCH 2/2] crypto: hisilicon - avoid unused function warning To: Herbert Xu Cc: Zhou Wang , "David S. Miller" , Jonathan Cameron , Hao Fang , Kenneth Lee , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Sep 19, 2019 at 3:48 PM Herbert Xu wrote: > > On Thu, Sep 19, 2019 at 04:11:13PM +0800, Zhou Wang wrote: > > On 2019/9/13 17:17, Herbert Xu wrote: > > > On Fri, Sep 06, 2019 at 05:22:30PM +0200, Arnd Bergmann wrote: > > >> The only caller of hisi_zip_vf_q_assign() is hidden in an #ifdef, > > >> so the function causes a warning when CONFIG_PCI_IOV is disabled: > > >> > > >> drivers/crypto/hisilicon/zip/zip_main.c:740:12: error: unused function 'hisi_zip_vf_q_assign' [-Werror,-Wunused-function] > > >> > > >> Move it into the same #ifdef. > > >> > > >> Fixes: 79e09f30eeba ("crypto: hisilicon - add SRIOV support for ZIP") > > >> Signed-off-by: Arnd Bergmann > > >> --- > > >> drivers/crypto/hisilicon/zip/zip_main.c | 2 ++ > > >> 1 file changed, 2 insertions(+) > > > > > > Please find a way to fix this warning without reducing compiler > > > coverage. I prefer to see any compile issues immediately rather > > > than through automated build testing. > > > > > > Thanks, > > > > > > > Sorry for missing this patch. > > > > Seems other drivers also do like using #ifdef. Do you mean something like this: > > #ifdef CONFIG_PCI_IOV > > sriov_enable() > > ... > > #else > > /* stub */ > > sriov_enable() > > ... > > #endif > > For an unused warning the unused compiler attribute would seem > to be the way to go. I sent an update patch now that also removes the first #ifdef, plus one that enables compile-testing on x86 (with some caveats). Arnd