Received: by 10.223.185.116 with SMTP id b49csp6247647wrg; Wed, 28 Feb 2018 06:25:16 -0800 (PST) X-Google-Smtp-Source: AG47ELupJiuDq1T0WdejBvCZvDit2ZrVRgrpRDFMiNR3B5GFo41tJRZv31iTcgNkwEYCGESqBg+K X-Received: by 2002:a17:902:a511:: with SMTP id s17-v6mr2841883plq.206.1519827916416; Wed, 28 Feb 2018 06:25:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519827916; cv=none; d=google.com; s=arc-20160816; b=wOOLrKtLWwqNuHVxr8/8V4p8NIpH+tl7rnfslbuJps1A2MyTLYSYx/ca626VgyLCzl RMRAc0XhmwBX+iBpni22aqVdBrqRvXXu4Bx+iR8ktEY/M97rf5pqtpJXJ14ERjJY+2U3 vZlGKIEnj8/l57yHWwP56fmIfRAQyKovWhTyPv6475U0//YAvqXHepEBJRZglLt60ben E6p76IXXhrgj/ACTucZAQTntDvX4sZr2DwmIUkiVm12JIAxSZXIObonb3rqyfxFJ2iV1 q4gBklqWJVzMAY/S2QsbQVtj7u0yYXpTCXEuoW7uQeqqOUSFJi/58agzJBSW1Ddt+hIa ffXg== 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 :references:in-reply-to:mime-version:arc-authentication-results; bh=JREZ7E+YVg2s4vJ0fwDx/DZ2PkxDEVwkBI1Fr0jesqQ=; b=r1+X7BGFeFFYYN8yKj6jW9LEeGm8WKgUwmjBibLbfa1lxsdld2kdq58J99Mwjg5PKt Sl/76PttagSBHZEIeHhQ3SNS0EYtD0I+Myg52y3G37qfX7Dw9xC8MoQygvYQRxwdybXZ NG2K4QtnDUlAxKU4cxWLEvV+aLFtlYNbE9lXwLJClaaMozBEgLTtecsbuWvqIKPds7am 8U2y2xcwOA4HCNYLKvjFzt8R4MpfnhWmoKBKmAWI53fivldq7nMLOLHwE40f5F3Z+Ffu r4t6cRlAJE5FQSkkk1jM5ljHzc649UHb5x62425w5Hdk7w3QFKz0tVBvlO7E5DGmVK4p hePw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k136si1098744pga.44.2018.02.28.06.25.01; Wed, 28 Feb 2018 06:25:16 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752777AbeB1OWz (ORCPT + 99 others); Wed, 28 Feb 2018 09:22:55 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:46253 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752499AbeB1OWx (ORCPT ); Wed, 28 Feb 2018 09:22:53 -0500 Received: by mail-qk0-f196.google.com with SMTP id 130so3105424qkd.13 for ; Wed, 28 Feb 2018 06:22:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JREZ7E+YVg2s4vJ0fwDx/DZ2PkxDEVwkBI1Fr0jesqQ=; b=FwvOQctiqszlbahIcLDcWdq0r2zbJrE1cDwMoG7ket5bU4Wkf8Ueiat9Ny4pnFN6RC F2VOMFMLzZNBe3nGzGJUA5l6m+GBE7g6WIn8IHRzlNE+R9N2JHDcJNlJMbBK601pUk5q l+AZcBR2sVNvN3XOI5wq0M+ARStbKakB9B1Jk/NsfKd6MEjfwZG2fDefF+ER2guy7IvC MsKFnhQ+L8bSmhPDbLCg2vJ1cbOsCguyXq3AoMQf3OeUl3p+sgBm4HORyBHErCdchuMc fAoFtrrVW6rwOygM8/lTvBb6kGgtA2HkA3pZwwoFVHIZAeLWJ0fcNWO2rdztgOb2XVEB NllQ== X-Gm-Message-State: APf1xPDwKftji4xGxmUDug6RL6OFigS7ElcgWF6TOzkLQ45Nj7eD4co9 US0juM/POKbYIm5TkfwBD71wOEYPw+kMilBKjxd2Ig== X-Received: by 10.55.209.137 with SMTP id o9mr28297278qkl.253.1519827772650; Wed, 28 Feb 2018 06:22:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.137.194 with HTTP; Wed, 28 Feb 2018 06:22:51 -0800 (PST) In-Reply-To: <20180228133357.1848600-1-arnd@arndb.de> References: <20180228133357.1848600-1-arnd@arndb.de> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Wed, 28 Feb 2018 15:22:51 +0100 Message-ID: Subject: Re: [PATCH] fw_cfg: avoid unused function warning To: Arnd Bergmann Cc: Gabriel Somlo , "Michael S. Tsirkin" , Vasyl Gomonovych , qemu-devel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On Wed, Feb 28, 2018 at 2:33 PM, Arnd Bergmann wrote: > The newly introduced fw_cfg_dma_transfer() function is unused when > CONFIG_CRASH_CORE is disabled: > > drivers/firmware/qemu_fw_cfg.c:89:16: error: 'fw_cfg_dma_transfer' defined but not used [-Werror=unused-function] > static ssize_t fw_cfg_dma_transfer(void *address, u32 length, u32 control) > > This moves it into the #ifdef section that hides its caller to avoid the > warning. > > Fixes: 47e78bfb5426 ("fw_cfg: write vmcoreinfo details") > Signed-off-by: Arnd Bergmann I don't know from which tree you found this, I suppose from mst/linux-next (which btw, I don't know which version got partially applied). This is a regression in v13, because dma read is last patch now, as RFC. Fixed in upcoming v16. thanks > --- > drivers/firmware/qemu_fw_cfg.c | 60 +++++++++++++++++++++--------------------- > 1 file changed, 30 insertions(+), 30 deletions(-) > > diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c > index 3015e77aebca..f002bb40519b 100644 > --- a/drivers/firmware/qemu_fw_cfg.c > +++ b/drivers/firmware/qemu_fw_cfg.c > @@ -66,6 +66,36 @@ static void fw_cfg_sel_endianness(u16 key) > iowrite16(key, fw_cfg_reg_ctrl); > } > > +/* read chunk of given fw_cfg blob (caller responsible for sanity-check) */ > +static ssize_t fw_cfg_read_blob(u16 key, > + void *buf, loff_t pos, size_t count) > +{ > + u32 glk = -1U; > + acpi_status status; > + > + /* If we have ACPI, ensure mutual exclusion against any potential > + * device access by the firmware, e.g. via AML methods: > + */ > + status = acpi_acquire_global_lock(ACPI_WAIT_FOREVER, &glk); > + if (ACPI_FAILURE(status) && status != AE_NOT_CONFIGURED) { > + /* Should never get here */ > + WARN(1, "fw_cfg_read_blob: Failed to lock ACPI!\n"); > + memset(buf, 0, count); > + return -EINVAL; > + } > + > + mutex_lock(&fw_cfg_dev_lock); > + fw_cfg_sel_endianness(key); > + while (pos-- > 0) > + ioread8(fw_cfg_reg_data); > + ioread8_rep(fw_cfg_reg_data, buf, count); > + mutex_unlock(&fw_cfg_dev_lock); > + > + acpi_release_global_lock(glk); > + return count; > +} > + > +#ifdef CONFIG_CRASH_CORE > static inline bool fw_cfg_dma_enabled(void) > { > return (fw_cfg_rev & FW_CFG_VERSION_DMA) && fw_cfg_reg_dma; > @@ -124,36 +154,6 @@ static ssize_t fw_cfg_dma_transfer(void *address, u32 length, u32 control) > return ret; > } > > -/* read chunk of given fw_cfg blob (caller responsible for sanity-check) */ > -static ssize_t fw_cfg_read_blob(u16 key, > - void *buf, loff_t pos, size_t count) > -{ > - u32 glk = -1U; > - acpi_status status; > - > - /* If we have ACPI, ensure mutual exclusion against any potential > - * device access by the firmware, e.g. via AML methods: > - */ > - status = acpi_acquire_global_lock(ACPI_WAIT_FOREVER, &glk); > - if (ACPI_FAILURE(status) && status != AE_NOT_CONFIGURED) { > - /* Should never get here */ > - WARN(1, "fw_cfg_read_blob: Failed to lock ACPI!\n"); > - memset(buf, 0, count); > - return -EINVAL; > - } > - > - mutex_lock(&fw_cfg_dev_lock); > - fw_cfg_sel_endianness(key); > - while (pos-- > 0) > - ioread8(fw_cfg_reg_data); > - ioread8_rep(fw_cfg_reg_data, buf, count); > - mutex_unlock(&fw_cfg_dev_lock); > - > - acpi_release_global_lock(glk); > - return count; > -} > - > -#ifdef CONFIG_CRASH_CORE > /* write chunk of given fw_cfg blob (caller responsible for sanity-check) */ > static ssize_t fw_cfg_write_blob(u16 key, > void *buf, loff_t pos, size_t count) > -- > 2.9.0 >