From patchwork Wed Mar 6 11:05:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10840857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF6C71515 for ; Wed, 6 Mar 2019 11:06:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD9452D671 for ; Wed, 6 Mar 2019 11:06:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB5762D67E; Wed, 6 Mar 2019 11:06:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65AF42D671 for ; Wed, 6 Mar 2019 11:06:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730314AbfCFLGO (ORCPT ); Wed, 6 Mar 2019 06:06:14 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:46255 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729762AbfCFLGN (ORCPT ); Wed, 6 Mar 2019 06:06:13 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1Mhl0I-1hWAM01cKe-00dnQT; Wed, 06 Mar 2019 12:06:04 +0100 From: Arnd Bergmann To: "Michael S. Tsirkin" , Jason Wang Cc: Arnd Bergmann , "David S. Miller" , Stefan Hajnoczi , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] vhost: silence an unused-variable warning Date: Wed, 6 Mar 2019 12:05:49 +0100 Message-Id: <20190306110602.2529137-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:00mDL8GvVd7KPBcJIzQn94nsSHWgxbvnaLDlVUbH50FOrZMdvRO QBEa+Zznpu/jFO2HI0BU2n5H0FcCtZ/xjFGPHcAJkwvBQkD4oQFx1skRY1E9sHMKlVLOEkn IflLyAsOEH0qyylRUx2yVvUM+b7oQ+bzH6hXmVTkDqISfXn2m4N4pNffR/4LRBrdLgVHbXC JrwkOdnAuTwxXAGejKzjw== X-UI-Out-Filterresults: notjunk:1;V03:K0:ouIxrelqti4=:zDF4itJL8Nvj2UbKQ0R/Me y+O/+E9CHpZ0IBFG2dl8uhyF0oEF7rK+9jIVR+4BRFKWiVu5aRmPB/Bcff4BLDUn19j1sJZhq XEWXlD311J6EeTSwwj691chpwdVkFdH5DmwQ35CBOUnmEfHILdagn62PlcLnaB6/MY4r8Cdfg uZLfjVI9k4+CH8hgnlxjvzkVnIUomQ8CrK7O8ZDYnLxUW3ODYkb1hfJY8A4062HRL5hLjGvjO dJ8AdqMzVEvDwzr7cY8UmqpCO+CR66dlejh24YB83IxiIugUTmhAcNiPUK94VsV6oG7Pw6Dy5 VL/9pb2BzOeNAtwT0Oks5drBD7xNyLOgbhz5UFeBFVdo5Nm3kI754rV5zUpK7X9csgfW+Ep9e pFBKcPkNh+a13HIrLNg2cGnrMAV/prV3fGvO4wa/B09Ilvm7EevAV1i/kOcFlOtgDcoHznuWA tjGGSHsttLvN4V6bp2U+b26M84DKTKUqEQKSqWasxtfc3HcaBn8UMLPsNWvFl2vuj29BxsesI ISnCckM6Wg/r6Ty2uSIgoITXj0fjNQri0J7s1/zcK5p8MNtc5eKA6HrX9E2BW/HvcpllQ6efu +ZnkYrvQiPzAi3u8+KPU815uwzX0UQebLisLyeOxmYITqJKm91aPYIQpdPDgibx46e3PS3W+L GiSNYDt3buZWBJhPBLE2pah9xPP3kxn+79QK68ZuoQGW534yds9GmtzU1af/93fWrORz9FkhR 8E08DArZ0bjWjy6W1lb6LT07jcpKzJqUkgiHYA== Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On some architectures, the MMU can be disabled, leading to access_ok() becoming an empty macro that does not evaluate its size argument, which in turn produces an unused-variable warning: drivers/vhost/vhost.c:1191:9: error: unused variable 's' [-Werror,-Wunused-variable] size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; Mark the variable as __maybe_unused to shut up that warning. Signed-off-by: Arnd Bergmann Acked-by: Jason Wang --- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index a2e5dc7716e2..5ace833de746 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1188,7 +1188,7 @@ static bool vq_access_ok(struct vhost_virtqueue *vq, unsigned int num, struct vring_used __user *used) { - size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; + size_t s __maybe_unused = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; return access_ok(desc, num * sizeof *desc) && access_ok(avail,