From: Shay Agroskin <shayagr@amazon.com>
To: Jakub Kicinski <kuba@kernel.org>, <netdev@vger.kernel.org>
Cc: Shay Agroskin <shayagr@amazon.com>,
David Woodhouse <dwmw@amazon.com>,
Zorik Machulsky <zorik@amazon.com>,
Alexander Matushevsky <matua@amazon.com>,
Bshara Saeed <saeedb@amazon.com>, Matt Wilson <msw@amazon.com>,
Anthony Liguori <aliguori@amazon.com>,
Nafea Bshara <nafea@amazon.com>, Guy Tzalik <gtzalik@amazon.com>,
Netanel Belgazal <netanel@amazon.com>,
Ali Saidi <alisaidi@amazon.com>,
Benjamin Herrenschmidt <benh@amazon.com>,
Arthur Kiyanovski <akiyano@amazon.com>,
Samih Jubran <sameehj@amazon.com>, Noam Dagan <ndagan@amazon.com>,
Alexander Duyck <alexander.duyck@gmail.com>,
Ido Segev <idose@amazon.com>, Igor Chauskin <igorch@amazon.com>
Subject: [PATCH net-next v5 3/9] net: ena: store values in their appropriate variables types
Date: Tue, 8 Dec 2020 20:02:02 +0200 [thread overview]
Message-ID: <20201208180208.26111-4-shayagr@amazon.com> (raw)
In-Reply-To: <20201208180208.26111-1-shayagr@amazon.com>
This patch changes some of the variables types to match the values they
hold. These wrong types fail some of our static checkers that search for
accidental conversions in our driver.
Signed-off-by: Ido Segev <idose@amazon.com>
Signed-off-by: Igor Chauskin <igorch@amazon.com>
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
---
drivers/net/ethernet/amazon/ena/ena_com.c | 15 +++++++--------
drivers/net/ethernet/amazon/ena/ena_com.h | 2 +-
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c
index e168edf3c930..02087d443e73 100644
--- a/drivers/net/ethernet/amazon/ena/ena_com.c
+++ b/drivers/net/ethernet/amazon/ena/ena_com.c
@@ -1360,16 +1360,15 @@ int ena_com_execute_admin_command(struct ena_com_admin_queue *admin_queue,
comp_ctx = ena_com_submit_admin_cmd(admin_queue, cmd, cmd_size,
comp, comp_size);
if (IS_ERR(comp_ctx)) {
- if (comp_ctx == ERR_PTR(-ENODEV))
+ ret = PTR_ERR(comp_ctx);
+ if (ret == -ENODEV)
netdev_dbg(admin_queue->ena_dev->net_device,
- "Failed to submit command [%ld]\n",
- PTR_ERR(comp_ctx));
+ "Failed to submit command [%d]\n", ret);
else
netdev_err(admin_queue->ena_dev->net_device,
- "Failed to submit command [%ld]\n",
- PTR_ERR(comp_ctx));
+ "Failed to submit command [%d]\n", ret);
- return PTR_ERR(comp_ctx);
+ return ret;
}
ret = ena_com_wait_and_process_admin_cq(comp_ctx, admin_queue);
@@ -1595,7 +1594,7 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_dev, u32 groups_flag)
int ena_com_get_dma_width(struct ena_com_dev *ena_dev)
{
u32 caps = ena_com_reg_bar_read32(ena_dev, ENA_REGS_CAPS_OFF);
- int width;
+ u32 width;
if (unlikely(caps == ENA_MMIO_READ_TIMEOUT)) {
netdev_err(ena_dev->net_device, "Reg read timeout occurred\n");
@@ -2247,7 +2246,7 @@ int ena_com_get_dev_basic_stats(struct ena_com_dev *ena_dev,
return ret;
}
-int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, int mtu)
+int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, u32 mtu)
{
struct ena_com_admin_queue *admin_queue;
struct ena_admin_set_feat_cmd cmd;
diff --git a/drivers/net/ethernet/amazon/ena/ena_com.h b/drivers/net/ethernet/amazon/ena/ena_com.h
index b0f76fb3b1d7..343caf41e709 100644
--- a/drivers/net/ethernet/amazon/ena/ena_com.h
+++ b/drivers/net/ethernet/amazon/ena/ena_com.h
@@ -605,7 +605,7 @@ int ena_com_get_eni_stats(struct ena_com_dev *ena_dev,
*
* @return: 0 on Success and negative value otherwise.
*/
-int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, int mtu);
+int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, u32 mtu);
/* ena_com_get_offload_settings - Retrieve the device offloads capabilities
* @ena_dev: ENA communication layer struct
--
2.17.1
next prev parent reply other threads:[~2020-12-08 18:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 18:01 [PATCH net-next v5 0/9] XDP Redirect implementation for ENA driver Shay Agroskin
2020-12-08 18:02 ` [PATCH net-next v5 1/9] net: ena: use constant value for net_device allocation Shay Agroskin
2020-12-08 18:02 ` [PATCH net-next v5 2/9] net: ena: add device distinct log prefix to files Shay Agroskin
2020-12-08 18:02 ` Shay Agroskin [this message]
2020-12-08 18:02 ` [PATCH net-next v5 4/9] net: ena: fix coding style nits Shay Agroskin
2020-12-08 18:02 ` [PATCH net-next v5 5/9] net: ena: aggregate stats increase into a function Shay Agroskin
2020-12-08 18:02 ` [PATCH net-next v5 6/9] net: ena: use xdp_frame in XDP TX flow Shay Agroskin
2020-12-08 18:02 ` [PATCH net-next v5 7/9] net: ena: introduce XDP redirect implementation Shay Agroskin
2020-12-08 18:02 ` [PATCH net-next v5 8/9] net: ena: use xdp_return_frame() to free xdp frames Shay Agroskin
2020-12-08 18:02 ` [PATCH net-next v5 9/9] net: ena: introduce ndo_xdp_xmit() function for XDP_REDIRECT Shay Agroskin
2020-12-09 23:50 ` [PATCH net-next v5 0/9] XDP Redirect implementation for ENA driver patchwork-bot+netdevbpf
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=20201208180208.26111-4-shayagr@amazon.com \
--to=shayagr@amazon.com \
--cc=akiyano@amazon.com \
--cc=alexander.duyck@gmail.com \
--cc=aliguori@amazon.com \
--cc=alisaidi@amazon.com \
--cc=benh@amazon.com \
--cc=dwmw@amazon.com \
--cc=gtzalik@amazon.com \
--cc=idose@amazon.com \
--cc=igorch@amazon.com \
--cc=kuba@kernel.org \
--cc=matua@amazon.com \
--cc=msw@amazon.com \
--cc=nafea@amazon.com \
--cc=ndagan@amazon.com \
--cc=netanel@amazon.com \
--cc=netdev@vger.kernel.org \
--cc=saeedb@amazon.com \
--cc=sameehj@amazon.com \
--cc=zorik@amazon.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.