DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] drivers/raw/skeleton: fix typecasting in skeleton_rawdev_enqueue_bufs()
@ 2022-07-06  6:32 Usman Tanveer
  2022-09-02  4:57 ` Usman Tanveer
  0 siblings, 1 reply; 2+ messages in thread
From: Usman Tanveer @ 2022-07-06  6:32 UTC (permalink / raw)
  To: sachin.saxena, hemant.agrawal; +Cc: dev, Usman Tanveer

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-02  4:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06  6:32 [PATCH] drivers/raw/skeleton: fix typecasting in skeleton_rawdev_enqueue_bufs() Usman Tanveer
2022-09-02  4:57 ` Usman Tanveer

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).