DPDK patches and discussions
 help / color / mirror / Atom feed
From: Usman Tanveer <usman.tanveer@emumba.com>
To: sachin.saxena@oss.nxp.com, hemant.agrawal@nxp.com
Cc: dev@dpdk.org, Usman Tanveer <usman.tanveer@emumba.com>
Subject: [PATCH] drivers/raw/skeleton: fix typecasting in skeleton_rawdev_enqueue_bufs()
Date: Wed,  6 Jul 2022 11:32:55 +0500	[thread overview]
Message-ID: <20220706063255.255325-1-usman.tanveer@emumba.com> (raw)

In function "skeleton_rawdev_enqueue_bugs", variable "context" is being
typecasted to (int*), and then assigned to a "uint16_t" type variable
"q_id". As the value is a "uint16_t", (int*) is replaced by (uint16_t*).

Signed-off-by: Usman Tanveer <usman.tanveer@emumba.com>
---
 drivers/raw/skeleton/skeleton_rawdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index 16ecae3d92..3f4da88747 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -421,7 +421,7 @@ static int skeleton_rawdev_enqueue_bufs(struct rte_rawdev *dev,
 	 * help in complex implementation which require more information than
 	 * just an integer - for example, a queue-pair.
 	 */
-	q_id = *((int *)context);
+	q_id = *((uint16_t *)context);
 
 	for (i = 0; i < count; i++)
 		queue_buf[q_id].bufs[i] = buffers[i]->buf_addr;
-- 
2.25.1


             reply	other threads:[~2022-07-06  6:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06  6:32 Usman Tanveer [this message]
2022-09-02  4:57 ` Usman Tanveer

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=20220706063255.255325-1-usman.tanveer@emumba.com \
    --to=usman.tanveer@emumba.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=sachin.saxena@oss.nxp.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).