From patchwork Thu Jun 1 08:48:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hawkins Jiawei X-Patchwork-Id: 1788865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=VC9/fW6s; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QX0Dj5XDvz20QJ for ; Thu, 1 Jun 2023 18:49:25 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4dz4-0001wl-Ke; Thu, 01 Jun 2023 04:48:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4dz0-0001w6-Md for qemu-devel@nongnu.org; Thu, 01 Jun 2023 04:48:34 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4dyz-0006F4-31 for qemu-devel@nongnu.org; Thu, 01 Jun 2023 04:48:34 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1b04706c974so4998355ad.2 for ; Thu, 01 Jun 2023 01:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685609311; x=1688201311; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XG/vGXSzD1X2DKFaeuOHuABz/AWh01w+UQ5wuAYsDFc=; b=VC9/fW6sc/V8UYBRccGkdo2wq/3jzaM/E/RrUDdIf7EpSClpNSHBYrXvpXMM2y6RX6 3Ci2U8qKoeIZpsKViSqn0YPKg1GqLpwQXVPOrxZxAd+8nwJMf3OoHR+ym3rbiSLWhljG zYOuyCZ1vuKCMfvILBQfA4KHpdiDJWR3LUpGnvtnIL3seMC86esIwnuJZxYscjlPQx65 5pB3Dyl0fPHlV1rW3bZi842WDBsci0cqN107TCr4NpazCFJ/cfwP7WLVy2HxbQ9oMBOv YGTvJwbErdUjEqN5HjLQB4kn3U2fq2nUoAY8kFgIRpu8IZVxJmSfTFqmxMpAFEQ91NJh rt5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685609311; x=1688201311; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XG/vGXSzD1X2DKFaeuOHuABz/AWh01w+UQ5wuAYsDFc=; b=P0DDJ83f0J292hM7lLNik9XH2Ceozpnh38R922SWp/ovX4hlFf0+ejPNM0DeLQcZgh jw3q0QIbwPzUJU6c9w9NBdA1AYBI84XUvlz65wHGOyB/036PmophRI68QFurf4GG1B19 8sVVbukIyMS4tTKeVnqoPYNOrP3h6nFRBXzp+27LU5tsB8SAe4FpExm5F6Ajm7CoSZTy Gpu/sUbiIzpzSwJSPaELRFcodBO0iLHuqsvpf7MhrvemPN3kqUgLhNH3TlOlkVeQLUhN Ow4x+2pzmx+Jk4MJj1mj/lgMTEKeUywTz273NZvBtXiYzQ3fRbFe3ej9M3u9M9W2NNsa bhgQ== X-Gm-Message-State: AC+VfDyxNIIuD1ElL0iozc7KkFfaVutxV13BqjDT1j3f/nHcOg+3iJ54 5r1TFIVl+xcHt8HboV3VKYk= X-Google-Smtp-Source: ACHHUZ48Wulsp0cKE6Q4Rl1n34wjHUCaQ2eb8l+xpUqERNXWzbdT29U0hehdL6AqF44M23ILwe9yXA== X-Received: by 2002:a17:902:b10a:b0:1af:d812:d27 with SMTP id q10-20020a170902b10a00b001afd8120d27mr6775204plr.9.1685609311360; Thu, 01 Jun 2023 01:48:31 -0700 (PDT) Received: from localhost ([117.136.38.170]) by smtp.gmail.com with ESMTPSA id b21-20020a170902d31500b001a221d14179sm2824091plc.302.2023.06.01.01.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 01:48:30 -0700 (PDT) From: Hawkins Jiawei To: jasowang@redhat.com, mst@redhat.com, eperezma@redhat.com Cc: qemu-devel@nongnu.org, yin31149@gmail.com Subject: [PATCH v2 1/6] include/hw/virtio: make some VirtIODevice const Date: Thu, 1 Jun 2023 16:48:15 +0800 Message-Id: <194d91a57682c661d3550a9d12006033adc8b803.1685584543.git.yin31149@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=yin31149@gmail.com; helo=mail-pl1-x636.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The VirtIODevice structure is not modified in virtio_vdev_has_feature(). Therefore, make it const to allow this function to accept const variables. Signed-off-by: Hawkins Jiawei --- include/hw/virtio/virtio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index af86ed7249..0492d26900 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -402,7 +402,7 @@ static inline bool virtio_has_feature(uint64_t features, unsigned int fbit) return !!(features & (1ULL << fbit)); } -static inline bool virtio_vdev_has_feature(VirtIODevice *vdev, +static inline bool virtio_vdev_has_feature(const VirtIODevice *vdev, unsigned int fbit) { return virtio_has_feature(vdev->guest_features, fbit);