From: Liming Sun <limings@nvidia.com>
To: Vadim Pasternak <vadimp@nvidia.com>,
David Thompson <davthompson@nvidia.com>,
Hans de Goede <hdegoede@redhat.com>,
Mark Gross <markgross@kernel.org>,
Dan Carpenter <dan.carpenter@linaro.org>
Cc: Liming Sun <limings@nvidia.com>,
<platform-driver-x86@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v1 1/1] platform/mellanox: mlxbf-tmfifo: Fix a warning message
Date: Thu, 5 Oct 2023 08:18:01 -0400 [thread overview]
Message-ID: <bb8bc77e6ecc2287fc9110cfa08caa48eb2a0385.1696508228.git.limings@nvidia.com> (raw)
This commit fixes the smatch static checker warning in
mlxbf_tmfifo_rxtx_word() which complains data not initialized at
line 634 when IS_VRING_DROP() is TRUE. This is not a real bug since
line 634 is for Tx while IS_VRING_DROP() is only set for Rx. So there
is no case that line 634 is executed when IS_VRING_DROP() is TRUE.
This commit initializes the local data variable to avoid unnecessary
confusion to those static analyzing tools.
Signed-off-by: Liming Sun <limings@nvidia.com>
---
drivers/platform/mellanox/mlxbf-tmfifo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c
index f3696a54a2bd..ccc4b51d3379 100644
--- a/drivers/platform/mellanox/mlxbf-tmfifo.c
+++ b/drivers/platform/mellanox/mlxbf-tmfifo.c
@@ -595,8 +595,8 @@ static void mlxbf_tmfifo_rxtx_word(struct mlxbf_tmfifo_vring *vring,
{
struct virtio_device *vdev = vring->vq->vdev;
struct mlxbf_tmfifo *fifo = vring->fifo;
+ u64 data = 0;
void *addr;
- u64 data;
/* Get the buffer address of this desc. */
addr = phys_to_virt(virtio64_to_cpu(vdev, desc->addr));
--
2.30.1
next reply other threads:[~2023-10-05 13:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-05 12:18 Liming Sun [this message]
2023-10-06 12:53 ` Hans de Goede
2023-10-06 15:50 ` Liming Sun
2023-10-06 17:06 ` Hans de Goede
2023-10-09 19:28 ` Liming Sun
2023-10-10 8:05 ` Hans de Goede
2023-10-12 23:03 ` Liming Sun
2023-10-12 23:02 ` [PATCH v2] " Liming Sun
2023-10-18 13:41 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bb8bc77e6ecc2287fc9110cfa08caa48eb2a0385.1696508228.git.limings@nvidia.com \
--to=limings@nvidia.com \
--cc=dan.carpenter@linaro.org \
--cc=davthompson@nvidia.com \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=vadimp@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®