From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB787C433EF for ; Mon, 16 May 2022 10:44:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C0B0A8421F; Mon, 16 May 2022 12:43:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="d38I875Q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 197AA84264; Mon, 16 May 2022 12:42:26 +0200 (CEST) Received: from mail-wm1-x349.google.com (mail-wm1-x349.google.com [IPv6:2a00:1450:4864:20::349]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 78564841A5 for ; Mon, 16 May 2022 12:42:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=3fCqCYgYKBvMVnXpggbjjbgZ.Xjhp-Wjjogdnon.YZis.YZ@flex--ascull.bounces.google.com Received: by mail-wm1-x349.google.com with SMTP id k35-20020a05600c1ca300b003946a9764baso10160268wms.1 for ; Mon, 16 May 2022 03:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=jBhmL02BPQgBlTj7uqI8b/hj09RrP+3At7ZEY0gfEmM=; b=d38I875QThoLKLgdooMPkHUJPJBbjSi9k11e8IfxJ8IkxF4WTMtg0UAoJm6LvsNLkd LQKFKMn5mciZUBYAcoi7fRh4NuVYUcTN0ILPhatWF3dq7gCzMAK9xKrUV7XvYe1tFSsI j7RMjcSvUiSYI+FLZoYakUigRJuPHKnJzWjTj8R7eXhE0ke9wqQ/Rme15Jv3DWMIz/zj BBc5XcaNxi6sNptu/3ZYtKaJC/oxUNFokqrQTa/7P07FfXHwEgeCMC7wF1weWYef3QcK 4i+CAzEFFWb0NVrbPoOH6wfCkDc6YQFkx+Ly1DQEunTKnM8v1ao1bCF/uctX+JHnRVFe YKfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=jBhmL02BPQgBlTj7uqI8b/hj09RrP+3At7ZEY0gfEmM=; b=4Gnf7NjucKhoRNgws3MYSWdY25YhVpmXW0y6saHWzizg/ZY5k6lvr1BVstQXIKxGTF 7fR71D4LsTz14bqx36hTfW33zTZrY59RC1SJp2r1nZI9mVxI5m3jZGgGD7xXtLSwniBq AEavcFnNEYrgBOTO00w8cSyKhIABGTNGyKtWz5oujQWIjQbRZeIqYdF8n/0gix9qUB8w jQ5Svc7RU6KiyHzgbT26ltYaMesrwFrH66nwMrAXkp6c9uNaIHRKInUhPCPZSwQlr8EY ddZno4CGwm3K4T6wIBL6fwRH1sleqvQV3o4y4CvresRPHr/Kx7ecHkHp0U1gUd7zdcNb RtGQ== X-Gm-Message-State: AOAM531QvAk52FPAsSDwtBf1dpLYx8J0RAkaJ+pP4IsJY45+XTG0QUf6 K3+S/hobVToLAm73kdlT0N4RUBLMnxQb1Xgv5sNfIb0C0MDuhg5mz7cgazQIr1QWwj8aXb3YU3D Lf5iygdhIR90Y/OcPDC/ZjQFlKl1bejzbKjC0fRIip6WTgjjGgWTcAvo1vnI= X-Google-Smtp-Source: ABdhPJwzcicl+k5/+1SFiQFxXQAnPAVFqJ4fctA0EWaUuppQAGImIxy14F7l9fu5XYQSsb5Q0ra6t0TM9c0= X-Received: from ascull.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1510]) (user=ascull job=sendgmr) by 2002:a5d:6c64:0:b0:20c:d910:aa8c with SMTP id r4-20020a5d6c64000000b0020cd910aa8cmr13676755wrz.138.1652697724537; Mon, 16 May 2022 03:42:04 -0700 (PDT) Date: Mon, 16 May 2022 10:41:34 +0000 In-Reply-To: <20220516104140.1047229-1-ascull@google.com> Message-Id: <20220516104140.1047229-7-ascull@google.com> Mime-Version: 1.0 References: <20220516104140.1047229-1-ascull@google.com> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH v3 06/12] virtio: sandbox: Fix device features bitfield From: Andrew Scull To: u-boot@lists.denx.de Cc: sjg@chromium.org, trini@konsulko.com, bmeng.cn@gmail.com, Andrew Scull Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean The virtio sandbox transport was setting the device features value to the bit index rather than shifting a bit to the right index. Fix this using the bit manipulation macros. Signed-off-by: Andrew Scull Reviewed-by: Simon Glass --- drivers/virtio/virtio_sandbox.c | 2 +- test/dm/virtio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_sandbox.c b/drivers/virtio/virtio_sandbox.c index aafb7beb94..a73b123454 100644 --- a/drivers/virtio/virtio_sandbox.c +++ b/drivers/virtio/virtio_sandbox.c @@ -160,7 +160,7 @@ static int virtio_sandbox_probe(struct udevice *udev) struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(udev); /* fake some information for testing */ - priv->device_features = VIRTIO_F_VERSION_1; + priv->device_features = BIT_ULL(VIRTIO_F_VERSION_1); uc_priv->device = VIRTIO_ID_BLOCK; uc_priv->vendor = ('u' << 24) | ('b' << 16) | ('o' << 8) | 't'; diff --git a/test/dm/virtio.c b/test/dm/virtio.c index adef10592c..aa4e3d778e 100644 --- a/test/dm/virtio.c +++ b/test/dm/virtio.c @@ -77,7 +77,7 @@ static int dm_test_virtio_all_ops(struct unit_test_state *uts) ut_assertok(virtio_get_status(dev, &status)); ut_asserteq(0, status); ut_assertok(virtio_get_features(dev, &features)); - ut_asserteq(VIRTIO_F_VERSION_1, features); + ut_asserteq_64(BIT_ULL(VIRTIO_F_VERSION_1), features); ut_assertok(virtio_set_features(dev)); ut_assertok(virtio_find_vqs(dev, nvqs, vqs)); ut_assertok(virtio_del_vqs(dev)); -- 2.36.0.550.gb090851708-goog