Received: by 10.223.185.116 with SMTP id b49csp6194762wrg; Wed, 28 Feb 2018 05:35:38 -0800 (PST) X-Google-Smtp-Source: AG47ELspjWHCnJ0glvf/1t7eAMvhmtoClM2qmK3g6uPGOEhv/h9SGlM4mq5x9fgKBlvWYfMaOL3M X-Received: by 10.98.68.154 with SMTP id m26mr6681400pfi.171.1519824938693; Wed, 28 Feb 2018 05:35:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519824938; cv=none; d=google.com; s=arc-20160816; b=EiiOTStrXPbLY/fVj3lSaL9wA7GO5Lg8a4BnW4vzVH15xHpkhZxR5yEztzw7VKzioi 6JLI/muBdC6SKeD9+Xr9AhJNVAHdEJqq0+8clQXASLCFxNjAVRkV7M3ft9ok90+AApos c5UkIcw+I6V5qPJWyKErJOHoz+g3Ao98kxVvcjBmW14kcXQdnIABSAAnDJOu6nYnDvpE qYd7F2IxmzJ6Q4pCXCqQeI3m7whFIavhLCFxAxq/H/puGDSt7JtaY/mUqfoObD8IQY38 JywYBcJKBYYdNhv3zb2EJpB8qOFiHuWbM+zmtV1wTKIjvuP28Gl5ReqMF/qwkrZ0M94c h3MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=B1r8CWbhV6YY46sZKNiBIt3bxlqIFsRtLSB/33hhRBs=; b=O0Iq/Nbk/hb5sE8AAaRS1sVPdGBy7ohMYHgHKykZtRJVmWJNHpE3wEbGtwmlkID0Tx SmtcwePMh4tiY34Dl7Cs/1wtPwNSQXxMmJmH+eCiK4wmPYugFetVNUb+1dbNWo5RkNx5 EI7W4h9QDux3x6QbNd14EkDYBzwGUUH9ywLBmF0ze+hXw3orU/oxIU7LSz40TqhVFLAF OMdejEvt/xHbSeFkaknHeJmLP8n7M1xnQYZW/jLlDR5+j0OkS05kGvIdJ8FIzWxIl/Te py5+7zB9sTfGPq/ct/6xX7OfO5MXkBGvAGA/8paHZfy2CCKr9VP128I1OH3fyhv6XVbz 82ng== 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 b89-v6si1270017plb.809.2018.02.28.05.35.21; Wed, 28 Feb 2018 05:35:38 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932242AbeB1NeP (ORCPT + 99 others); Wed, 28 Feb 2018 08:34:15 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:57295 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932185AbeB1NeN (ORCPT ); Wed, 28 Feb 2018 08:34:13 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0MKdqV-1epe9g40wR-001yQe; Wed, 28 Feb 2018 14:34:00 +0100 From: Arnd Bergmann To: Gabriel Somlo , "Michael S. Tsirkin" Cc: Arnd Bergmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Vasyl Gomonovych , qemu-devel@nongnu.org, linux-kernel@vger.kernel.org Subject: [PATCH] fw_cfg: avoid unused function warning Date: Wed, 28 Feb 2018 14:33:49 +0100 Message-Id: <20180228133357.1848600-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:BrHYVvR3dpn9WUCBjSId6/kWQbpReZhJFSRN6/W1vAwWdFj76zf 0aElZkGPffnu3N+WdN4/K27U3gE5DD50GbKfuZXosBlL1mJh+eIMEw+OzoCmSIq6rxFT1Kd 0TS5xO1d6IAGalcczNwhjq88bPjQU1xbyn1uBHTthejnU1p0sMQpUVlFs7XIE7Upzh8dasj 3h/vYKieFX6sypHruofAQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:TFXL65DSNA8=:RDj2BYfaHk0THwxjYA6rC7 GpxdJ1T2QWo3fI65tPK5kdT+boEf95NNi8sF6QRpSf06yV8SX6uxSjyvMM/gv9zNw/xnNFOTD US68SrF9Dy0rzxyfmRMx8M8i9l394DpC0a34fhS0f8Bq2ttLcdiBj6TaDzYVh4mf6qd5ndKst OvqTyC4Iy9tymhp8EwNxn/3tlwc7NQWb/gCLldw/JvkAcdHwwpz6cG8cfaBC45RhJrfi7w+aD vIz+odm2J/5L/zKtRpafcV1J8nFWqHimcwa19gVRr9k8CoZecjxcGqUGe1azXgiQ8uAZ8FBDX nr3L2jxUAkHRBRDmXI4HrM3rHThvsnQnF6Ya1mR9tnvhAR+kGw5JL3fWvgNb7ni1ONDWz/HLk EIalgFH59yzbyrBO7PGUFsuEhIVKofnI9mPtSyAj38L8syoNLHXYnbu9A+8/5udahqw5om0zM 9DeIEOYg63xQNPRCToHaLwSo6Igik4203cNSHwHhjUKTFqiEgO749bxcG1mpCcclQ+ikW07+T NWwlHGxycua2J9BJND95eIpP03Q2H7jfDVWVxU4u8YQYfYdaZgt1z+r1V25eg2caliKXOBNsR b2excilWmXNgYW07QkUwnuGhNnsugvp12y8I52xu3FWa1wQ+8kvYXSE/vmfT6Ck0A16ta++Kf eKqpcCbrbcfKA0QlMFL81y1eDFpocCPZFxqL2i49u4kG7aEUw6hNc0CFSdyWRQ9Zn9lGDvl9c +Ls6wTPqx8Jw3haVxlwc2EHGr3+dtgMWxOWmDg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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