From: wangyunjian <wangyunjian@huawei.com>
To: <dev@dpdk.org>
Cc: <anatoly.burakov@intel.com>, <jerry.lilijun@huawei.com>,
<xudingke@huawei.com>, Yunjian Wang <wangyunjian@huawei.com>
Subject: [dpdk-dev] [PATCH] vfio: remove unnecessary explicit type casting
Date: Wed, 16 Sep 2020 20:41:56 +0800 [thread overview]
Message-ID: <677e6331b63389275fb1b1009fbea5642028e506.1600259975.git.wangyunjian@huawei.com> (raw)
From: Yunjian Wang <wangyunjian@huawei.com>
The variables 'vfio_res->nb_maps' and 'i' are of type int. The type
casting of 'vfio_res->nb_maps' is redundant and not required.
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
drivers/bus/pci/linux/pci_vfio.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index c15ed3bad..85a51e3e2 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -750,7 +750,7 @@ pci_vfio_map_resource_primary(struct rte_pci_device *dev)
}
}
- for (i = 0; i < (int) vfio_res->nb_maps; i++) {
+ for (i = 0; i < vfio_res->nb_maps; i++) {
struct vfio_region_info *reg = NULL;
void *bar_addr;
@@ -875,7 +875,7 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev)
/* map BARs */
maps = vfio_res->maps;
- for (i = 0; i < (int) vfio_res->nb_maps; i++) {
+ for (i = 0; i < vfio_res->nb_maps; i++) {
ret = pci_vfio_mmap_bar(vfio_dev_fd, vfio_res, i, MAP_FIXED);
if (ret < 0) {
RTE_LOG(ERR, EAL, " %s mapping BAR%i failed: %s\n",
@@ -934,7 +934,7 @@ find_and_unmap_vfio_resource(struct mapped_pci_res_list *vfio_res_list,
pci_addr);
maps = vfio_res->maps;
- for (i = 0; i < (int) vfio_res->nb_maps; i++) {
+ for (i = 0; i < vfio_res->nb_maps; i++) {
/*
* We do not need to be aware of MSI-X table BAR mappings as
--
2.23.0
next reply other threads:[~2020-09-16 12:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 12:41 wangyunjian [this message]
2020-09-16 13:38 ` Burakov, Anatoly
2020-09-16 14:14 ` Burakov, Anatoly
2020-10-05 8:13 ` David Marchand
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=677e6331b63389275fb1b1009fbea5642028e506.1600259975.git.wangyunjian@huawei.com \
--to=wangyunjian@huawei.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=jerry.lilijun@huawei.com \
--cc=xudingke@huawei.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;
as well as URLs for NNTP newsgroup(s).